11-13-2010, 06:50 AM
[eluser]mariogl[/eluser]
Hi. I'm trying to migrate my site to CodeIgniter. I have doubts about how to implement my js files.
In my previous system, I include separate js files (common.js, forms.js, lists.js) depending on which controller is being called. Actually, most of them are php files (forms.js.php) that generate javascript code, because I use some php classes and constants inside. Each js.php file has a php initialization code at start, which is the same one that use all the controllers.
Now, with CodeIgniter, I don't know which is the best way to do this. What I want is that those javascript files (included by <script src=...) load the core and all my initial stuff, that I have put in MY_Controller.
I've searched, I've read about render js files as views, but I can't see it clear.
Thanks for any help.
Hi. I'm trying to migrate my site to CodeIgniter. I have doubts about how to implement my js files.
In my previous system, I include separate js files (common.js, forms.js, lists.js) depending on which controller is being called. Actually, most of them are php files (forms.js.php) that generate javascript code, because I use some php classes and constants inside. Each js.php file has a php initialization code at start, which is the same one that use all the controllers.
Now, with CodeIgniter, I don't know which is the best way to do this. What I want is that those javascript files (included by <script src=...) load the core and all my initial stuff, that I have put in MY_Controller.
I've searched, I've read about render js files as views, but I can't see it clear.
Thanks for any help.