03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Multisites 212<br />

1 <br />

2 {{ Lang::get("multisite::steps.instructions") }}<br />

3 <br />

.<br />

This was extracted from app/views/www/index/index.blade.php.<br />

It’s as easy at that!<br />

.<br />

You can learn more about package resources at: http://laravel.com/docs/packages#packageconfiguration.<br />

Caching Language Lookups<br />

Getting translated phrases from the filesystem can be an expensive operation, in a big system. What<br />

would be even cooler is if we could use Laravel 4’s built-in cache system to make repeated lookups<br />

more efficient.<br />

To do this, we need to create a few files, and change some old ones:<br />

1 // 'Lang' => 'Illuminate\Support\Facades\Lang',<br />

2 "Lang" => "Formativ\Multisite\Facades\Lang",<br />

.<br />

This was extracted from app/config/app.php.<br />

This tells Laravel 4 to load our own Lang facade in place of the one that ships with Laravel 4. We’ve<br />

got to make this facade…

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

Saved successfully!

Ooh no, something went wrong!