Posted by admin on 25 Mär 2012 in Yii framework
for all tables the following:
- Module Generator
- Model Generator
- CRUD Generator
for all tables the following:
Path for a giix code in crud generator:
Model Class
application.modules.heatflow.models.Heatflow
Controller ID
heatflow/Heatflow
Meanwhile another error message is coming:
Table 'heatflow' has a composite primary key which is not supported by crud generator.
I have a try to giix Extension. I am lazy and think is better to install extensions for better building the code.
public function validateModel($attribute,$params)
{
if($this->hasErrors('model'))
return;
$class=@Yii::import($this->model,true);
if(!is_string($class) || !$this->classExists($class))
$this->addError('model', "Class '{$this->model}' does not exist or has syntax error.");
else if(!is_subclass_of($class,'CActiveRecord'))
$this->addError('model', "'{$this->model}' must extend from CActiveRecord.");
else
{
$table=CActiveRecord::model($class)->tableSchema;
if($table->primaryKey===null)
$this->addError('model',"Table '{$table->name}' does not have a primary key.");
else if(is_array($table->primaryKey))
$this->addError('model',"Table '{$table->name}' has a composite primary key which is not supported by crud generator.");
else
{
$this->_modelClass=$class;
$this->_table=$table;
}
}
}
Solution will be a workaround to that composite primary key. Using only one primary key. Other keys can not be primary.
For valuable work on creation of sites you need a good comfortable editor necessarily. There are many requiring paid products for this purpose, but we would like to select free of charge very functional and at the same time of simple in the use editor - Codelobster PHP Edition .
Developer | Codelobster Software |
Web Site | http://www.codelobster.com/ |
Language | English, Russian, German, Spanish, French, Portuguese |
Supported OS | Windows 2000, Windows XP, Windows Vista, Windows 7 |