Welcome Guest, Not a member yet? Register   Sign In
get files/name of loaded views
#1

[eluser]bas_vdl[/eluser]
Hello,

is there a way to get an array with the actual loaded views.

i want to check if view (search/form) is loaded in my template file so i can load the javascript files only when needed.

thank you
#2

[eluser]slowgary[/eluser]
I'm not sure but couldn't you just put the javascript into the view that requires it?

You could also just define() a constant in each view:
Code:
if(!defined('header_view'))
{
     define('header_view');
}

Then in another view...
Code:
if(defined('header_view'))
{
     echo "< script type='text/javascript' src='library.js' >< /script >";
}

You can also use get_defined_constants(), which will return an associative array of defined constants.




Theme © iAndrew 2016 - Forum software by © MyBB