JaquelineBrandao / yii

Automatically exported from code.google.com/p/yii
0 stars 0 forks source link

yiic not generating models under a module #845

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using yiic tool, create a module: module timesheet
2. create a table in DB called timesheetShift
3. using yiic tool, create a model within the module: model
timesheet.timesheetShift

What is the expected output? What do you see instead?
I would expect to find a model generated under modules/timesheet/models.
Instead there is no model generated there, nor is there a model generated
in protected/models.  The unit test and fixture for the model are generated
however,  there is just no actual model being created.  

What version of the product are you using? On what operating system?
1.1 (build 1678) on XAMPP stack, Windows 7.

Original issue reported on code.google.com by lxm...@googlemail.com on 19 Jan 2010 at 7:37

GoogleCodeExporter commented 9 years ago
Is the module loaded in the config used by Yiic??

Original comment by sebathi on 20 Jan 2010 at 6:45

GoogleCodeExporter commented 9 years ago
Cheers, 

Now that I have added the module to the config file the module is generated, 
but it
is generated in the root of the module folder, not in the models subdirectory.  

Eg. model is generated at protected/modules/moduleName/model.php and not at
protected/modules/moduleName/models/model.php.  

Not sure if this is a bug after all.

Original comment by lxm...@googlemail.com on 24 Jan 2010 at 4:18

GoogleCodeExporter commented 9 years ago
And further to this, the crud moduleName.modelName command fails because it is
seeking the model file in the root of the module.

Eg. 
Model is in protected/modules/moduleName/models/SampleModel.php
Execute yiic command - crud moduleName.SampleModel
Fails with message :
Warning: include(L:\Working
Data\Projects\Celeb\Site\protected\modules\moduleName\SampleModel.php): failed 
to
open stream: No such file or directory in L:\Work
ing Data\Projects\Celeb\Site\yii\framework\YiiBase.php on line 335

It only works if the model file is copied into the module's root.

Original comment by lxm...@googlemail.com on 24 Jan 2010 at 8:01

GoogleCodeExporter commented 9 years ago
You should use timesheet.models.ModelClassName

Original comment by qiang.xue on 24 Jan 2010 at 8:08