[英]What is the correct way to include css, js and image files into the template with Kohana?
With Kohana, using a Templating system, what is the correct way to link to the style sheets, javascript files and most importantly images? 使用Kohana,使用模板系统,链接到样式表,javascript文件和最重要的图像的正确方法是什么?
Shall I add <?php echo url::base() ?>
in front of links? 我应该在链接前面添加
<?php echo url::base() ?>
吗? This surely does work but doesn't seem like the correct way to do things. 这确实可以工作,但似乎不是正确的处理方式。
What is the correct way? 正确的方法是什么?
DOCROOT
somewhere: DOCROOT/assets/images/
DOCROOT
某个位置: DOCROOT/assets/images/
url::base().'assets/images/thing.png
url::site('assets/images/thing.png')
<base href="<?=url::base()?>
(then use normal relative links in your html) <base href="<?=url::base()?>
(然后在HTML中使用普通的相对链接)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.