Laravel3:变量必须永远设置


Laravel3: Variables that has to be set forever

<meta name="description" content="{{ $description }}" />

是存储在custom.config.php中的变量。文件可以在任何地方。(我是Laravel的新手)

我如何确保Laravel每次都运行它?我不打算每次调用视图时都使用->with('description', $description');

寻找类似:{{ Config::get('website_description') }}

您可以将该变量添加到before路由过滤器中:

Route::filter('before', function()
{
    //Do stuff before every request to your application...
    $website_description = Config::get('website_description');  
    View::share('website_description', $website_description);
});