Created
May 22, 2015 17:18
-
-
Save jdavidbakr/0115b812b7c2eaf940b4 to your computer and use it in GitHub Desktop.
Snippet: Laravel View Composer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
<?php | |
namespace ${1:App\Http\ViewComposers}; | |
use View; | |
use Illuminate\Support\ServiceProvider; | |
class ${2:My}ViewComposer extends ServiceProvider { | |
public function boot() { | |
View::composer('${3:*}', function(\$view) { | |
\$view->with('${4:variable}', '${5:value}'); | |
}); | |
} | |
public function register() { | |
} | |
} | |
?> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>view</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment