Reputation: 15108
I have a basic install of Laravel 4.
I have set up layouts and templating using blade 4.
I have a logo and a css file in my assets directory.
/public/assets/img/logo.png
/public/assets/css/style.css
My layout is located:
/app/views/layouts/master.blade.php
What is the correct way to include these?
I have tried this for the logo for example:
But returns nothing. It also seems like laravel 4 and blade would have a more 'proper' way of doing it.
Upvotes: 1
Views: 100
Reputation: 632
you need to use the HTML helper
class.
for your CSS to appear in your <head>
as a stylesheet link use:
{{ HTML::style('assets/css/style.css') }}
for your images use:
{{ HTML::image('assets/img/logo.png') }}
There are also HTMLBuilder
methods for .js
files and other things which are HTML-related. Note that the URLs are relative to /public
in your Laravel install.
For more information, you can consult the API docs at:
http://laravel.com/api/4.1/ I can't seem to link directly to a class, so navigate on the left to Illuminate\Html\HtmlBuilder
Upvotes: 1