Base_Controller: Access current controller name in Laravel -
i trying current controller name in base of operations controller in laravel 3.2 returns null. within home controller there's no problem.
how can value within base_controller
?
<?php class base_controller extends controller { public $page_data = array(); public function __call($method, $parameters) { homecoming response::error('404'); } public function __construct() { $this->page_data['body_id'] = request::$route->controller; parent::__construct(); } }
why don't utilize get_called_class() if have php 5.3 available can controllers class name? workaround though , not looking for...
controller laravel laravel-3
No comments:
Post a Comment