Page library |
[eluser]Al James[/eluser]
Hi there... As discussed here: http://ellislab.com/forums/viewthread/49910/P45/#279320 I think that functions for linking css and js files should be broken out of the view library and put into a separate 'page' library. I have written a basic page library. Features: * Automatic linking of CSS and JS files (as per coolfactors idea in his view library) * Ability to set title, description and keywords meta tags. * Ability to pass values directly into the javascript environment (uses json_encode, so its PHP 5 or PHP 4 + the json extension) * Ability to set javascript code to be executed in the window.onload function. I will post the code in the next reply as its too long to include here! Example usage: Controller: Code: $this->page->set_title('My page'); In the view file: Code: <html> Outputs: Code: <html> |
Messages In This Thread |
Page library - by El Forum - 07-19-2007, 02:57 AM
Page library - by El Forum - 07-19-2007, 03:00 AM
Page library - by El Forum - 12-10-2007, 02:50 PM
Page library - by El Forum - 12-10-2007, 03:06 PM
Page library - by El Forum - 12-10-2007, 03:34 PM
Page library - by El Forum - 12-10-2007, 03:55 PM
Page library - by El Forum - 12-10-2007, 04:54 PM
Page library - by El Forum - 12-10-2007, 07:10 PM
Page library - by El Forum - 12-13-2007, 08:24 AM
Page library - by El Forum - 12-13-2007, 08:38 AM
Page library - by El Forum - 04-20-2011, 08:04 AM
|