bit0123
(Kaushik Itdu)
1
I have a table named category in my database.
I have created a model named Category.php under models/Admin directory
I have also ran CRUD operation under controllers/Admin directory
This had created view files successfully under site/Admin directory.
Now the problem is- when i try to browse "http://localhost/Application/index.php/Admin/category"
then the Error 404 occurs.
Unable to resolve the request "Admin".
Please suggest me what should i do now?
rivoot
(Me)
2
That’s because the URL Manager is actually looking for the AdminController file, not the CategoryController file under an “Admin” directory.
If you’re using that kind of directory structure I’d recommend you to use modules instead:
http://www.yiiframework.com/doc/guide/1.1/en/basics.module
Also, read about URL Management so you can understand why you’re getting the 404 error:
http://www.yiiframework.com/doc/guide/1.1/en/topics.url
bit0123
(Kaushik Itdu)
3
@ mauriciorivera
Thanks for quick reply.
I have tried to use Module.
But the problem is CRUD is not creating View files under view directory though i am specifying
the full path of Module’s Model and Module_name/Controller.
Then what can i do?
saegeek
(Abdallah)
4
You may not add an “Admin” sub-directory under models, that’s surely why yii doesnt want to generate view files.