Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('SYSPATH') or die('No direct script access.');
- /**
- * Html head helper methods
- *
- * @package Layout Module
- * @author John Himmelman (john2496@gmail.com)
- */
- class Head
- {
- protected static $stylesheets = array();
- protected static $scripts = array();
- public static function get_scripts()
- {
- $ret = '';
- foreach (self::$scripts as $file)
- {
- $ret .= html::script($file) . "\n";
- }
- return $ret;
- }
- public static function get_stylesheets()
- {
- $ret = '';
- foreach (self::$stylesheets as $file)
- {
- $ret .= html::style($file) . "\n";
- }
- return $ret;
- }
- public static function include_scripts()
- {
- echo self::get_scripts();
- }
- public static function include_stylesheets()
- {
- echo self::get_stylesheets();
- }
- public static function add_javascript($file)
- {
- self::$scripts[] = $file;
- }
- public static function add_stylesheet($file)
- {
- self::$stylesheets[] = $file;
- }
- public static function javascript($file)
- {
- return self::add_javascript($file);
- }
- public static function stylesheet($file)
- {
- return self::add_stylesheet($file);
- }
- }
Add Comment
Please, Sign In to add comment