I'm using pyrocms to develop a system.
I know that, to include style links in header tag '' in a page is by using $this->template->set_metadata().
But how can I include javascript links like that?
Any answer is appreciated.
I'm using pyrocms to develop a system.
I know that, to include style links in header tag '' in a page is by using $this->template->set_metadata().
But how can I include javascript links like that?
Any answer is appreciated.
If you are creating a template you can do it like this:
{js('file.js', 'modulename')}
See the Pyro documentation.
If this is not the answer you are looking for, please explain more clearly what you want. E.g. in which file exactly do you want to include your javascript?
Alternatively, if this is for a theme and the script is housed within your actual theme/js folder, it becomes:
{theme_js('file.js')}
Using just the {js} function would send it to the actual system's embedded js files.
$this->template->append_metadata(js('foo.js)) will work, or you can dump it into the view as others have suggested.