Yii Framework Forum: Gii: CRUD creation for model in Module - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Gii: CRUD creation for model in Module Doesn't load files into module folders but default folders Rate Topic: ****- 1 Votes

#1 User is offline   whoopass 

  • Advanced Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 27-May 09
  • Location:Ajax, Ontario, Canada

Posted 07 June 2010 - 09:22 PM

I'm not sure if this is intentional or that much of a bug however when operating Gii I can create modules fine, and then I can thus create models in the module no problem (using the application.modules.modulename.models as the path) and so forth.

However when I go to create a CRUD operation for the model for the module, using application.modules.modulename.models.modelname

it displays the preview of everything generating under the default views and controller folders (as opposed to the ones associated with the module).

This isn't a huge issue as files can be copied to the right place, however if code was ever associated with production based on location in the directory, then there would be issues.

Not sure if anyone else has gotten this little set back. Otherwise Gii works awesome and is a really creative idea.

Anymore information required, let me know.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,871
  • Joined: 04-October 08
  • Location:DC, USA

Posted 07 June 2010 - 10:13 PM

You need to specify the ControllerID with the module name, e.g. admin/post
3

#3 User is offline   whoopass 

  • Advanced Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 27-May 09
  • Location:Ajax, Ontario, Canada

Posted 08 June 2010 - 11:52 AM

View Postqiang, on 07 June 2010 - 10:13 PM, said:

You need to specify the ControllerID with the module name, e.g. admin/post


Awesome figured it out, thanks. We can probably move this to a more likely checked section for assisting users later, I've uploaded a screen shot so readers can view the actual inputs and results.

Attached File  Understanding Modules - Controllers.PNG (62.53K)
Number of downloads: 972
4

#4 User is offline   balrok 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 13-June 10

Posted 21 August 2010 - 05:36 AM

thanks for posting your solution - it helped..

and another thing: if your crud still won't be created under the modules directory - don't forget to add the module into your config
0

#5 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 357
  • Joined: 23-July 09

Posted 16 November 2010 - 10:27 PM

Has something changed with this, or is there a new bug? Using a two day old SVN version, when using as was posted in the picture, I get paths like the following in the preview:

controllers\users\UsersController.php
views\users\users\_form.php
views\users\users\_search.php

etc. etc

The files are generated as the paths show, and actually work, but I would expect them to be generated within the module

ehh! Figured it out - please remember to update your configuration file after creating your module :)
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#6 User is offline   xJose 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-February 14

Posted 04 June 2014 - 09:29 AM

thanks for this, I coulnd't figured it out but now I do :D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users