03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Deployment 88<br />

26 }<br />

27<br />

28 if (ends_with($use, ".js"))<br />

29 {<br />

30 $markup .= "";<br />

34 }<br />

35 }<br />

36 }<br />

37<br />

38 return $markup;<br />

39 });<br />

.<br />

This file should be saved as app/macros.php.<br />

This macro accepts a single parameter — the name of the section — and renders HTML markup<br />

elements for each asset file. It doesn’t matter if there are a combination of stylesheets and scripts as<br />

the applicable tag is rendered for each asset type.<br />

We also need to make sure this file gets included in our application’s startup processes:<br />

1 require app_path() . "/macros.php";<br />

.<br />

This was extracted from app/start/global.php.<br />

We can now use this in our templates…

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!