diff --git a/extensions/elasticsearch/ActiveRecord.php b/extensions/elasticsearch/ActiveRecord.php index e6e28b7..3afadf6 100644 --- a/extensions/elasticsearch/ActiveRecord.php +++ b/extensions/elasticsearch/ActiveRecord.php @@ -10,9 +10,9 @@ namespace yii\elasticsearch; use yii\base\InvalidCallException; use yii\base\InvalidConfigException; use yii\db\BaseActiveRecord; -use yii\helpers\FileHelper; use yii\helpers\Inflector; use yii\helpers\Json; +use yii\helpers\StringHelper; /** * ActiveRecord is the base class for classes representing relational data in terms of objects. @@ -226,7 +226,7 @@ class ActiveRecord extends BaseActiveRecord */ public static function index() { - return Inflector::pluralize(Inflector::camel2id(FileHelper::basename(get_called_class()), '-')); + return Inflector::pluralize(Inflector::camel2id(StringHelper::basename(get_called_class()), '-')); } /** @@ -234,7 +234,7 @@ class ActiveRecord extends BaseActiveRecord */ public static function type() { - return Inflector::camel2id(FileHelper::basename(get_called_class()), '-'); + return Inflector::camel2id(StringHelper::basename(get_called_class()), '-'); } /** diff --git a/extensions/gii/generators/crud/templates/controller.php b/extensions/gii/generators/crud/templates/controller.php index c1ce71f..bb5d3f4 100644 --- a/extensions/gii/generators/crud/templates/controller.php +++ b/extensions/gii/generators/crud/templates/controller.php @@ -1,7 +1,7 @@ controllerClass); -$modelClass = FileHelper::basename($generator->modelClass); -$searchModelClass = FileHelper::basename($generator->searchModelClass); +$controllerClass = StringHelper::basename($generator->controllerClass); +$modelClass = StringHelper::basename($generator->modelClass); +$searchModelClass = StringHelper::basename($generator->searchModelClass); if ($modelClass === $searchModelClass) { $searchModelAlias = $searchModelClass.'Search'; } @@ -27,7 +27,7 @@ $actionParamComments = $generator->generateActionParamComments(); echo " -namespace controllerClass, '\\')) ?>; +namespace controllerClass, '\\')) ?>; use modelClass, '\\') ?>; use searchModelClass, '\\') ?> as ; @@ -38,7 +38,7 @@ use yii\web\VerbFilter; /** * implements the CRUD actions for model. */ -class extends baseControllerClass) . "\n" ?> +class extends baseControllerClass) . "\n" ?> { public function behaviors() { diff --git a/extensions/gii/generators/crud/templates/search.php b/extensions/gii/generators/crud/templates/search.php index 1a9da82..1411896 100644 --- a/extensions/gii/generators/crud/templates/search.php +++ b/extensions/gii/generators/crud/templates/search.php @@ -1,6 +1,6 @@ modelClass); -$searchModelClass = FileHelper::basename($generator->searchModelClass); +$modelClass = StringHelper::basename($generator->modelClass); +$searchModelClass = StringHelper::basename($generator->searchModelClass); $rules = $generator->generateSearchRules(); $labels = $generator->generateSearchLabels(); $searchAttributes = $generator->getSearchAttributes(); @@ -19,7 +19,7 @@ $searchConditions = $generator->generateSearchConditions(); echo " -namespace searchModelClass, '\\')) ?>; +namespace searchModelClass, '\\')) ?>; use yii\base\Model; use yii\data\ActiveDataProvider; diff --git a/extensions/gii/generators/crud/templates/views/_form.php b/extensions/gii/generators/crud/templates/views/_form.php index 4ac7971..52538d5 100644 --- a/extensions/gii/generators/crud/templates/views/_form.php +++ b/extensions/gii/generators/crud/templates/views/_form.php @@ -1,7 +1,7 @@ -
+
$form = ActiveForm::begin(); ?> diff --git a/extensions/gii/generators/crud/templates/views/_search.php b/extensions/gii/generators/crud/templates/views/_search.php index 6ba9ee0..af2f948 100644 --- a/extensions/gii/generators/crud/templates/views/_search.php +++ b/extensions/gii/generators/crud/templates/views/_search.php @@ -1,7 +1,7 @@ -