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 91<br />

52 );<br />

53 }<br />

54<br />

55 return $collection;<br />

56 }<br />

57<br />

58 protected function setOutput($file, $content)<br />

59 {<br />

60 $path = $this->getPath();<br />

61 return File::put($path . "/" . $file, $content);<br />

62 }<br />

63 }<br />

.<br />

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

Here’s where we make use of Assetic. Among the many utilities Assetic provides; the AssetCollection<br />

and FileAsset classes will be out main focus. The getCollection() method accepts a commadelimited<br />

list of asset files (relative to the public folder) and returns a populated AssetCollection<br />

instance.<br />

1

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

Saved successfully!

Ooh no, something went wrong!