Posted By

Actuarybrad on 11/11/09


Tagged

php kohana


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

xmartyxcorex
goliatone


Kohana Javascript Helper


 / Published in: PHP
 

  1. <?php defined('SYSPATH') OR die('No direct access allowed.');
  2.  
  3. class javascript_Core
  4. {
  5. static protected $scripts = array();
  6.  
  7. static public function add($file)
  8. {
  9. self::$scripts[] = $file;
  10. }
  11.  
  12. static public function render($print = FALSE)
  13. {
  14. $output = '';
  15. foreach (self::$scripts as $script)
  16. $output .= html::script($script);
  17.  
  18. if ($print)
  19. echo $output;
  20.  
  21. return $output;
  22. }
  23. } // End javascript_Core

Report this snippet  

You need to login to post a comment.