CodeIgniter动态钩子

I am using CI 3.0 to call a script in display_override hook that will replace tokens such as [[templatedata:head]] which will include all the scripts and CSS associated with a template's head section, thus it will inject the relevant < script > as < link > tags in the template, but since different templates may have different scripts, this needs to be dynamically determined at injection time. The source of the script is an array in a configuration file with the template name as the array key.

Is there a way that I can set a regular variable or session variable to hold that template name to be accessible by the hook script in order to call the right array sub section of scripts?

The problem was resolved by changing the hook that did the script and link replacement to run post_controller as opposed to pre_controller, and set a static variable in the main index.php file, which then gets updated where the template is called, and thus do the necessary replacement for the template.