Using PHP code in the Template library configuration file? |
[eluser]parham90[/eluser]
Hello, I have downloaded a library called Template library for CodeIgniter. While it is very good, I want to define a default menu bar for my whole application in the configuration. There's a problem with this, however. The items in the configuration file, apparently, do not get parsed. So if I put PHP code in the configuration file, it will just stay as is, and appear in the final HTML page. I am assuming what I need to do is to find something that runs every time a page is requested, and set the menu there. For example: Code: $data['menu') = "<ul> Is there a more clean workaround? If not, where do you recommend I put this code? Thanks!
[eluser]gyo[/eluser]
This is a perfect situation to extend the main Controller using MY_Controller. Enjoy!
[eluser]danmontgomery[/eluser]
Code: $data['menu'] = "<ul>
[eluser]parham90[/eluser]
Hi! Thanks! I thought even though I am autoloading 'url', it won't get loaded when the configuration files are read. *smiles* [quote author="noctrum" date="1280444493"] Code: $data['menu'] = "<ul> |
Welcome Guest, Not a member yet? Register Sign In |