0
我正在为Laravel4准备一个捆绑包,并且找不到如何将可配置路线添加到我的捆绑包的方法。动态laravel4服务提供商路线
实施例:
//this is from the service provider of the bundle
public function register()
{
...
$this->registerRoutes();
...
}
protected function registerRoutes()
{
//The way of doing into the documentation or other bundles is
//the problem is that I cannot put the routes to be from the config file
//and they cannot be overwritten from the app configuration.
include __DIR__ . '/routes.php';
}
//This method gives an error
protected function registerTestRoutes()
{
$this->app['imager'] = $this->app->share(function($app)
{
//$route = 'admin/images/{$image_id}
$route = $app['config']['imager::config']['delete_url'];
return \Route::delete($route, array('uses' => 'CompanyName\Imager\Controllers\[email protected]'));;
});
}
请添加一个别名到应用程序/ routes.php文件可以为您详细你得到的错误,只是说它给出了错误,并不能帮助任何人与你一起调试。 – 2013-04-11 11:43:22