23 Mar 2012 9:13 AM #1
Commad Sencha Generate with namespace
How can I do to generate model/controller with namespace like...
sencha generate model admin.User
/model |_ /admin |_User.js
Last edited by relson; 23 Mar 2012 at 9:21 AM. Reason: Formatting to let more clear
24 Mar 2012 7:55 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
The issue is that the folder structure doesn't adhere to the dot notation namespace but the name of the model is correct right?
I can see the model having the right name but the path doesn't look like it supports this:
this.template('model.js', path.join('app', 'model', args.name + '.js'));Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
24 Apr 2013 5:26 AM #3
It seems like sencha CMD expects all models to be in the "model" directory and when used in store it should be like:
model: 'ModelName' #which translates to App.model.ModelName
so far so good, but if i want to specify the model name like this:
sencha cmd will translate this to App.model.App.model.ModelName and the file will not be found.
This is very useful when you have multiple apps like Core, App1, App2 and App1, App2 stores use the model definitions from Core.
While in browser this works fine, sencha cmd does not understand this.
Is there a way around this?
Is it possible to modify that line which generates the filepath for models? Can we dig somewhere in sencha cmd and modify it on our one so that when args.name contains a dot, consider it the full class name and not append the current applucation namespace.