Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The controller has been generated successfully. You may try it now. *wrong link* #182

Closed
FedericoBenedetti1976 opened this issue Aug 25, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@FedericoBenedetti1976
Copy link

FedericoBenedetti1976 commented Aug 25, 2016

hi all, i'm using gii to generate only my controller.
I want to create it in my directory "app\controllers\set\MyController"

I generate without problem and it tell me: The controller has been generated successfully. You may try it now
The link point to: http://mydomain.com/my/index
but it generate 404 not found because the right link is: http://mydomain.com/set/my/index

i don't know if it's a bug or not.
Bye

@SilverFire
Copy link
Member

SilverFire commented Aug 27, 2016

The controller must be located under controllers directory. If you want to prefix route with set - pack your controller in the set module, or simply configure appropriate rule in UrlManager.

It you wanna know how, read the runtime routing section and the modules section as well.

@cebe
Copy link
Member

cebe commented Aug 29, 2016

@SilverFire controllers can be located in subdirectories:

http://www.yiiframework.com/doc-2.0/guide-structure-controllers.html#controller-ids

@cebe cebe reopened this Aug 29, 2016
@cebe cebe added type:bug Bug and removed question labels Aug 29, 2016
@SilverFire
Copy link
Member

SilverFire commented Aug 30, 2016

😨 shame on me. Completely forgot about this feature :(

@samdark samdark added this to the 2.0.6 milestone Sep 9, 2016
MaksimKiselev added a commit to MaksimKiselev/yii2-gii that referenced this issue Jan 26, 2017
MaksimKiselev added a commit to MaksimKiselev/yii2-gii that referenced this issue Jan 28, 2017
@samdark samdark self-assigned this Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants