Revision #171 has been created by rackycz on Mar 19, 2020, 9:48:17 PM with the memo:
gii
« previous (#170) next (#172) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
});
</script>
</html>
```
**Enhancing Gii**
---
If you do not like entering long model-paths and controller-paths in CRUD-generator, you can modify text boxes in "\vendor\yiisoft\yii2-gii\src\generators\crud\form.php" and enter default paths and then only manually add the name of the model.
```php
if (!$generator->modelClass) {
echo $form->field($generator, 'modelClass')->textInput(['value' => 'app\\models\\']);
echo $form->field($generator, 'searchModelClass')->textInput(['value' => 'app\\models\\*Search']);
echo $form->field($generator, 'controllerClass')->textInput(['value' => 'app\\controllers\\*Controller']);
} else {
echo $form->field($generator, 'modelClass');
echo $form->field($generator, 'searchModelClass');
echo $form->field($generator, 'controllerClass');
}
```