Questions tagged [gii]

Gii is the web-based code generation tool of Yii Framework. While you can add your own code templates to Gii, it is equipped with templates for Controllers, CRUDs, Forms, Models and Modules.

Starting from version 1.1.2, Yii is equipped with a Web-based code generation tool called Gii. It supersedes the previous yiic shell generation tool, which runs on command line.

Detailed instructions about Gii can be found here: http://www.yiiframework.com/doc/guide/1.1/en/topics.gii

163 questions
1
vote
1 answer

Unable to open Gii in Yii Framework on localhost

I am trying to open the gii module on my yii based project on localhost. But its not opening. I am using virtual hosts to access the project (http://pys.dev not http://localhost/pys.dev). if (YII_ENV_DEV) { // configuration adjustments for 'dev'…
Pawan Kumar
  • 594
  • 4
  • 18
1
vote
0 answers

Yii Crud generates ErrorException out of the box

My problem is similar (or identical ?) to this one. However, the solution offered there does not help me. I used Gii tot generate a model (Guest) with a search model (GuestQuery). Then I used Gii to generate CRUD for these models. Gii generates the…
Ivo Renkema
  • 2,188
  • 1
  • 29
  • 40
1
vote
1 answer

Why does gii, when creating CRUD, change my view path from ldopt to ld-opt?

Is ldopt a reserved word in yii/php for some reason. The actual table is called LdOpt. So the model generated is also called LdOpt Then when generating the CRUD I set model class to app\models\LdOpt and Search Model class to app\models\LdOptSearch…
Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
1
vote
2 answers

Yii2 - Gii extension assets folder alias referencing to a wrong path

I am trying to learn Yii 2 from a book (Web application development with Yii2 and PHP). Somewhere along the line it instructs me to install gii and create crud files with it. When I installed with the following command: php composer.phar require…
SercioSoydanov
  • 980
  • 10
  • 29
1
vote
1 answer

Testing for POST in Yii 2.0

In my controllers that Gii creates it is common to see the following: if($model->load(Yii::$app->request->post()) && $model->save()){ //.....do something such as redirect after save....// }else { //.....render the form in initial…
Scott
  • 107
  • 1
  • 1
  • 15
1
vote
1 answer

How to access gii using homestead

I am using homestead as my dev environment for my yii2 tutorial and my problem is I cannot configure the lines below to access gii in http://hostname/index.php?r=gii 'gii' => [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['127.0.0.1',…
1
vote
2 answers

Yii2 Gii not showing Generate button

I got the Gii module working but when I try to create a Model using the generator, I click preview, the page refreshes but nothing happens - no generate button, no warning, no error and nothing in the logs. Any advice or comment very…
kfa
  • 2,106
  • 4
  • 17
  • 22
1
vote
0 answers

In Yii2, how can I incorporate many-to-many relationships into the crud

Apologies, as I am new to the MVC structure (and frameworks, for that matter). After using gii to generate my CRUD, I can tinker and get a given "Create" form to display a dropdown populated by choices from a related one-to-many table. So far so…
Reid
  • 11
  • 2
1
vote
1 answer

Yii model not bulid relation automatically using gii

HI i never faced this type of problem. Please clarify me when i did wrong. I tried to generate 2 model which have relation but it didn't come in models. Here are the Db structure. CREATE TABLE IF NOT EXISTS `property` ( `property_id` int(11) NOT…
uiTeam324
  • 1,215
  • 15
  • 34
1
vote
1 answer

Yii Validate an un-bound Variable (non-stored)

Classic problem: verify that a user accepted the contract terms but the value of the acceptance is not stored (bound) in the database... Extend CFormModel rather than CActiveForm (because CActiveForm binds values to DB) Post a CFormModel to a…
David Urry
  • 807
  • 1
  • 8
  • 15
1
vote
0 answers

How to split my site in the Yii2 logic

Let's say, I have a mobile application, which goal is to facilitate the work of operators who work in the field with clients and their "top-brass" to track their KPI. It's already written on Yii 1.1 and now the task is to migrate this application on…
Павел Иванов
  • 1,863
  • 5
  • 28
  • 51
1
vote
0 answers

Yii2: Failed creating own template with GII module (advance template)

I have some problem here I have created an advance template with yii2, and i've followed "The Gii code generation tool" from http://www.yiiframework.com/doc-2.0/guide-gii.html copy folder default template cp…
bayoz
  • 99
  • 1
  • 11
1
vote
1 answer

Accessing Gii with active urlManager

I am using Yii framework version 1.1.14 and all that I want is to access Yii code generator Gii. It is possible by typing http://somegoodapp123/index.php?r=gii but if I activate urlManager, it is not possible. Could you please help me, how to…
kennySystemExit
  • 329
  • 2
  • 5
  • 22
1
vote
1 answer

Linux permissions issue with Yii using Gii

When I am trying to use Gii Controller Generator I get: file_put_contents(.../gii-1.1.14/ControllerCode.php): failed to open stream: Permission denied I have created a Yii demo project as a root so I recursively changed yiidemo(project's folder)…
Alan
  • 1,322
  • 1
  • 21
  • 36
1
vote
1 answer

Awecrud Yiistrap exception: AweActiveForm and its behaviors do not have a method or closure named "textFieldRow"

I have created a model using Awe Model and using the model I've generated the Awe crud. I am able to view the data in the DB, however when I'm trying to create the record, I get an exception: AweActiveForm and its behaviors do not have a method or…
friedFingers
  • 245
  • 6
  • 18