php - Laravel3: Variables that has to be set forever -
<meta name="description" content="{{ $description }}" />
it variable stored in custom.config.php
. file can anywhere. (i'm new laravel)
how can ensure laravel runs each time? i'm not going use ->with('description', $description');
every time call view.
looking like: {{ config::get('website_description') }}
you can add variable before route filter:
route::filter('before', function() { //do stuff before every request application... $website_description = config::get('website_description'); view::share('website_description', $website_description); });
you can directly access variable in view.
Comments
Post a Comment