I try to get the nested controller in Laravel 4 based on the following structure:
- app
- controllers
- base
- BaseController.php
- website
- WebsiteController.php
- base
- controllers
I want to get the website route to be associated with WebsiteController that extend BaseController.
I've try the following thing
for route.php (app/route.php)
Route::resource('website', 'Controllers\Website\WebsiteController');
for BaseController.php (app/controllers/base/BaseController.php)
use Illuminate\Routing\Controllers\Controller;
class BaseController extends Controller {
protected function setupLayout(){
if ( ! is_null($this->layout)){
$this->layout = View::make($this->layout);
}
}
}
for WebsiteController.php (app/controllers/website/WebsiteController.php)
use Controllers\Base\BaseController;
class WebsiteController extends BaseController {
public function index(){
return 'index';
}
}
Unfortunately when i go to http://mywebsite.com/website it's not working at all.
Thank you.