ExtJS::Generator::DBIC::Model - ExtJS model producer
version 0.003
use ExtJS::Generator::DBIC::Model; my $generator = ExtJS::Generator::DBIC::Model->new( schemaname => 'My::DBIC::Schema', appname => 'MyApp', # defaults to $appname.model model_namespace => 'MyApp.model', # defaults to $appname.data.Model model_baseclass => 'MyApp.data.Model', #model_args => { # schema => 'schemaalias', #}, ); my $extjs_model_for_foo = $generator->extjs_model('Foo'); my @extjs_models = $generator->extjs_models; $generator->extjs_model_to_file( 'Foo', '/my/dir/' ); $generator->extjs_all_to_file( '/my/dir/' );
Creates ExtJS model classes.
At the moment only version 6 of the ExtJS framework is supported.
The name of the DBIx::Class::Schema which should be used to generate the ExtJS model classes.
A DBIx::Class::Schema instance, automatically instantiated from the schemaname if not specified.
The ExtJS app name used as base namespace for all generated classes.
The ExtJS model namespace, defaults to $appname.model.
The ExtJS model baseclass name from which all generated model classes should be extended.
Hashref which takes arbitrary ExtJS model attributes which are added to each generated ExtJS model class..
Returns the ExtJS model name for a table. Should be overridden in a subclass if the default naming doesn't suit you. E.g. MyApp::Schema::Result::ARTist -> MyApp.model.Artist
Returns the ExtJS model alias for an ExtJS model returned from "extjs_model_name". Should be overridden in a subclass if the default naming doesn't suit you. E.g. MyApp.model.Artist -> 'model.artist'
Returns the ExtJS model entityName for a full ExtJS classname. E.g. MyApp.model.Foo -> Foo
This method returns an arrayref containing the parameters that can be serialized to JavaScript and then passed to Ext.define for one DBIx::Class::ResultSource.
This method returns the generated ExtJS model classes as hashref indexed by their ExtJS names.
This method takes a single DBIx::Class::ResultSource name and a directory name and outputs the generated ExtJS model class to a file according to ExtJS naming standards. An error is thrown if the directory doesn't exist or if the file already exists.
This method takes a directory name and outputs the generated ExtJS base model class to a file according to ExtJS naming standards.
This method takes a root directory name and outputs all generated ExtJS classes to a file per class according to ExtJS naming standards.
http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.data.Model for ExtJS model documentation.
Alexander Hartmaier <abraxxa@cpan.org>
This software is copyright (c) 2016 by Alexander Hartmaier.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install ExtJS::Generator::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ExtJS::Generator::DBIC
CPAN shell
perl -MCPAN -e shell install ExtJS::Generator::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.