08-06-2023, 04:14 PM
I'm newbie in **laravel 4.0**.
- How to get the whole array from `lang/en/texts.php`?
- Is there a `Lang::getAll()` method?
My goal is to generate keywords/description in my base controller, to fill them into the the meta tags and other places in the DOM in the master blade template. If my approach is completely wrong, please tell me!
Generating the keywords and description from an associative array is NOT the problem, but the lack of knowledge about the framework. And, I was googling for quite a time before ending up here...
Working with blade templates:
This is my BaseController:
class HomeController extends BaseController {
protected $layout = 'layouts.master';
private $keyWords = array();
private function getKeyWords () {
// ???
}
public function getIndex() {
return View::make('home')
->with('errorcanvas', trans('texts.canvas'))
->with('errortextwebgl', trans('texts.webgl'))
...;
}
...
}
----------
I found something in the [API][1]:
`Illuminate\Translation\FileLoader load()` which loads the messages with a given `locale`
...
[1]:
- How to get the whole array from `lang/en/texts.php`?
- Is there a `Lang::getAll()` method?
My goal is to generate keywords/description in my base controller, to fill them into the the meta tags and other places in the DOM in the master blade template. If my approach is completely wrong, please tell me!
Generating the keywords and description from an associative array is NOT the problem, but the lack of knowledge about the framework. And, I was googling for quite a time before ending up here...
Working with blade templates:
This is my BaseController:
class HomeController extends BaseController {
protected $layout = 'layouts.master';
private $keyWords = array();
private function getKeyWords () {
// ???
}
public function getIndex() {
return View::make('home')
->with('errorcanvas', trans('texts.canvas'))
->with('errortextwebgl', trans('texts.webgl'))
...;
}
...
}
----------
I found something in the [API][1]:
`Illuminate\Translation\FileLoader load()` which loads the messages with a given `locale`
...
[1]:
[To see links please register here]