わかりました、私が使用する完全なroutes.php
ファイル...私はちょうどここにそれを貼り付けました:http://pastebin.com/kaCP3NwK
ルート.php
//The route group for all other requests needs to validate admin, model, and add assets
Route::group(array('before' => 'validate_admin|validate_model'), function()
{
//Model Index
Route::get('admin/(:any)', array(
'as' => 'admin_index',
'uses' => 'admin@index'
));
管理者設定:
...
'models' => array(
'news' => array(
'title' => 'News',
'single' => 'news',
'model' => 'AdminModels\\News',
),
...
リンクジェネレータ:
@foreach (Config::get('administrator.models') as $key => $model)
@if (Admin\Libraries\ModelHelper::checkPermission($key))
<?php $key = is_numeric($key) ? $model : $key; ?>
<li>
{{ HTML::link(URL::to_route('admin_index', array($key)), $model['title']) }}
</li>
@endif
@endforeach
controllers / admin.php
public function action_index($modelName)
{
//first we get the data model
$model = ModelHelper::getModelInstance($modelName);
$view = View::make("admin.index",
array(
"modelName" => $modelName,
)
);
//set the layout content and title
$this->layout->modelName = $modelName;
$this->layout->content = $view;
}
したがって、にアクセスhttp://example.com/admin/news
すると...news
に送信されaction_index
ますが、何らかの理由でそこに到達せず、返されます404