Welcome Guest, Not a member yet? Register   Sign In
Is there a way to get the controller name inside a view?
#1

[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


Messages In This Thread
Is there a way to get the controller name inside a view? - by El Forum - 06-12-2009, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB