具有以下控制器:Laravel路线REST风格的控制器
class Admin_Images_Controller extends Admin_Controller
{
public $restful = true;
public function __construct()
{
parent::__construct();
}
public function get_index($id)
{
echo $id;
}
我不明白为什么我的时候不带参数的访问为它工作,因为我得到一个错误说missing parameter for ...
ID,但是当我真正尝试通过参数http://site/admin/images/12
我得到一个404
错误。我错过了什么?
我试着设置在我的路线下,没有成功之一:
Route::any('admin/images', array(
'as' => 'admin_images',
'uses' => '[email protected]',
));
//or
Route::any('admin/images/(:any)', array(
'as' => 'admin_images',
'uses' => '[email protected]',
));
它接缝,我带通配符的问题,90%的在我的测试的Linux envirnonment(Ubuntu的)发生。这是我目前使用的routes.php http://pastebin.com/f86A3Usx
随着路线,没有路线,在该顺序路线...它不会去......任何其他方法(post_index,post_myass,put_fireonwate,get_image,get_alife)它去,但不索引:| – Alex
我忘记了问号。检查我的更新并尝试。这应该是有效的 - 如果不行的话,还有其他的东西。 – Oddman