snipplrCallback({"id":22954,"title":"kohana-javascript-helper","source":"
<?php<\/span> defined<\/span><\/a>(<\/span>'SYSPATH'<\/span>)<\/span> OR die<\/span><\/a>(<\/span>'No direct access allowed.'<\/span>)<\/span>;<\/span><\/div><\/li> <\/div><\/li>class<\/span> javascript_Core<\/div><\/li>{<\/span><\/div><\/li>\tstatic protected<\/span> $scripts<\/span> =<\/span> array<\/span><\/a>(<\/span>)<\/span>;<\/span><\/div><\/li> <\/div><\/li>\tstatic public<\/span> function<\/span> add(<\/span>$file<\/span>)<\/span><\/div><\/li>\t{<\/span><\/div><\/li>\t\tself<\/span>::<\/span>$scripts<\/span>[<\/span>]<\/span> =<\/span> $file<\/span>;<\/span><\/div><\/li>\t}<\/span><\/div><\/li> <\/div><\/li>\tstatic public<\/span> function<\/span> render(<\/span>$print<\/span> =<\/span> FALSE<\/span>)<\/span><\/div><\/li>\t{<\/span><\/div><\/li>\t\t$output<\/span> =<\/span> ''<\/span>;<\/span><\/div><\/li>\t\tforeach<\/span> (<\/span>self<\/span>::<\/span>$scripts<\/span> as<\/span> $script<\/span>)<\/span><\/div><\/li>\t\t\t$output<\/span> .=<\/span> html::<\/span>script<\/span>(<\/span>$script<\/span>)<\/span>;<\/span><\/div><\/li> <\/div><\/li>\t\tif<\/span> (<\/span>$print<\/span>)<\/span><\/div><\/li>\t\t\techo<\/span> $output<\/span>;<\/span><\/div><\/li> <\/div><\/li>\t\treturn<\/span> $output<\/span>;<\/span><\/div><\/li>\t}<\/span><\/div><\/li>}<\/span> \/\/ End javascript_Core<\/span><\/div><\/li><\/ol><\/pre>","link":"https:\/\/snipplr.com\/view\/22954\/kohana-javascript-helper"});