문제

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.

도움이 되었습니까?

해결책

$this->template->append_metadata(js('foo.js)) will work, or you can dump it into the view as others have suggested.

다른 팁

Alternatively, if this is for a theme and the script is housed within your actual theme/js folder, it becomes:

{{ theme:js file="file.js" }}

Using just the {js} function would send it to the actual system's embedded js files.

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top