1
0

Added new (clean) yii boilerplate

This commit is contained in:
2014-05-13 12:40:42 +02:00
parent 1d6d975a16
commit 99d29b432b
1983 changed files with 653465 additions and 17 deletions

View File

@@ -0,0 +1,25 @@
<?php
class ModelGenerator extends CCodeGenerator
{
public $codeModel='gii.generators.model.ModelCode';
/**
* Provides autocomplete table names
* @param string $db the database connection component id
* @return string the json array of tablenames that contains the entered term $q
*/
public function actionGetTableNames($db)
{
if(Yii::app()->getRequest()->getIsAjaxRequest())
{
$all = array();
if(!empty($db) && Yii::app()->hasComponent($db)!==false && (Yii::app()->getComponent($db) instanceof CDbConnection))
$all=array_keys(Yii::app()->{$db}->schema->getTables());
echo json_encode($all);
}
else
throw new CHttpException(404,'The requested page does not exist.');
}
}