Phil
Phil

Reputation: 14671

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?

Shall I add <?php echo url::base() ?> in front of links? This surely does work but doesn't seem like the correct way to do things.

What is the correct way?

Upvotes: 1

Views: 1448

Answers (1)

zombor
zombor

Reputation: 3257

  1. Put the assets in your DOCROOT somewhere: DOCROOT/assets/images/
  2. Use any of the following:
    • url::base().'assets/images/thing.png
    • url::site('assets/images/thing.png')
    • <base href="<?=url::base()?> (then use normal relative links in your html)

Upvotes: 4

Related Questions