使用Kohana将css、js和图像文件包含到模板中的正确方法是什么


What is the correct way to include css, js and image files into the template with Kohana?

对于Kohana,使用模板系统,链接到样式表、javascript文件以及最重要的图像的正确方法是什么?

我应该在链接前面添加<?php echo url::base() ?>吗?这确实有效,但似乎不是正确的做事方式。

正确的方法是什么?

  1. 将资产放在DOCROOT的某个位置:DOCROOT/assets/images/
  2. 使用以下任意一项:
    • url::base().'assets/images/thing.png
    • url::site('assets/images/thing.png')
    • <base href="<?=url::base()?>(然后在html中使用正常的相对链接)