[eluser]jstuardo[/eluser]
I have created a PHP that contains common functions I have to use in a control panel I am programming. One function is called display_toolbar($title).
That function displays the title of the current page and a toolbar with some buttons, for example, "Create" or "Delete".
The anchor for those operations is different depending the controller. For example, if the toolbar is shown in the users list page, "Create" operation has to be:
Code:
anchor('usuario/create', '<img src="img.jpg" alt="Crear" />')
But for the list shown in events list page, "Create" operation has to be:
Code:
anchor('evento/create', '<img src="img.jpg" alt="Crear" />')
Is there a way to get the controller segment dinamically depending which controller was loaded?
Thanks in advance
Jaime