Gii tells you to modify your controller. It shows the code you should insert after generating process. When you do this you'll be able to access your form by http://yoursite.com/controller/action
You can manage your urls using UrlManager. Look this article in docs - http://www.yiiframework.com/doc/guide/1.1/en/topics.url
How to access a view once you have generated it with GII (via YII)?
Domanda
I've managed to create several forms using YII and GII, but I'll be honest, I don't understand it perfectly. If anyone can explain this to me, I'd really appreciate it.
Basically, I create accessed the form creator here:
index.php/gii/form
I then filled in:
Model Class: Product
View Name: createProduct
View Path: application.views (default)
Scenario: createProduct
When I generate the code, I end up with a file called "createProduct.php" located at:
protected\views\createProduct.php
- How do I access this view? I figured something like this should work: http://mysite.com/createProduct (but it doesn't)
- What do I do if I want to change the link to be: http://mysite.com/admin/products/createProduct
Any help would be greatly appreciated!
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow