CodeForge is a flexible code generating tool.
- Creating workspaces to make possibility to work with several entities at once.
- Generating models, views, controllers, sql schemas etc from description of the entities.
- Creating ready applications based on particular templates.
- Can be easy extended with extra features (generating custom form controls, widgets etc).
- Templates to build basic Yii application are included.
Look how it is easy:
Run following command in work directory:
sh > cf init php.yii.default
It creates workspace for basic Yii application.
sh > cf add Contact
then open codeforge/src/Contact.model and define some attributes:
model Contact scheme mysql, php.yii.model, php.yii.controller.crud, php.yii.view.crud:
/// Contact name
required attr name char(200);
/// Phone number
required attr phone char(200);
/// Email
required attr email email;
/// Category
attr category enum("Family", "Friend", "Work");
sh > cf add GlobalOptions
then open codeforge/src/GlobalOptions.model and fill it with something like this:
model GlobalOption scheme php.yii.model.options, php.yii.view.options, php.yii.controller.options:
/// Site name
required attr sitename char(100);
/// Tagline
required attr tagline text;
sh > cf build mysql php.yii.default
first time you need to answer several questions.
sh > cf release -o www
where www is document root of your web application. Then you need to create SQL schema. All SQL scripts can be found in www/data/sql:
sh > cd www/data/sql
sh > cat *.sql | mysql -uuser -ppassword dbname
Open in your browser http://yourapp.local/index.php/admin/ and login using following credentials:
Username: admin
Password: qwe
I used cf as command, you also can create alias as follow:
sh > alias cf="php /path/to/codeforge/codeforge.php"
Note that Yii framework is not included to template. You should put it to the same directory as www. Yii 1.1.14 should be used as framework.