Results 1 to 3 of 3

Thread: Commad Sencha Generate with namespace

  1. #1
    Sencha User relson's Avatar
    Join Date
    Dec 2011
    Location
    So Paulo, SP, Brasil
    Posts
    13
    Vote Rating
    1
      0  

    Lightbulb Commad Sencha Generate with namespace

    How can I do to generate model/controller with namespace like...

    Code:
    sencha generate model admin.User
    and then have a folder structure

    Code:
    /model
         |_ /admin
                    |_User.js
    on current version I have the outputed a file with dot separated admin.User.js in folder model
    Last edited by relson; 23 Mar 2012 at 9:21 AM. Reason: Formatting to let more clear

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    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:

    Code:
    this.template('model.js', path.join('app', 'model', args.name + '.js'));
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    47
    Vote Rating
    1
      0  

    Default

    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:
    model: 'App.model.ModelName'
    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.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •