R
R
Roman2015-03-30 18:59:55
PHP
Roman, 2015-03-30 18:59:55

How to wrap a php function in a tag?

There is a registration form. And after all, too lazy to write on each page what should be shown to the admin, what to the moderator, what to the guest, etc.
How to enclose it all in tags? To write for example:
<moder>Удалить запись</moder>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ramallah, 2015-03-30
@ramallah

Maybe a little out of the box, but I would recommend paying attention to template engines. Smarty, Twig, etc...
Both convenient and more readable.

M
Maxim Timofeev, 2015-03-30
@webinar

You can hide everything and show it using javascript depending on the class.
But it’s better to take this block into a separate logic and access it by passing parameters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question