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
41
votes
1 answer

Yii2 : ActiveQuery Example and what is the reason to generate ActiveQuery class separately in Gii?

Could you provide an example usage. Description will be highly appreciated. I can not find a good example for it.
Nahid Hossain
  • 772
  • 2
  • 7
  • 20
21
votes
8 answers

Yii2 Gii Forbidden code 403 You are not allowed to access this page

I have a server machine and I am trying to allow my PC ip address to use gii. My PC ip address is 192.168.1.101 The server machine ip is 192.168.1.102. I used composer to install the gii module. This is how my composer.json settings look…
Ionut Flavius Pogacian
  • 4,750
  • 14
  • 58
  • 100
11
votes
5 answers

getting Gii to work on Yii 2.0

i downloaded the advanced template, extracted it and changed the root documents for the back-end and the front-end, but i can't seem to figure out how to get Gii working to perform the crud operations. there is require and require-dev field in the…
tareq
  • 1,119
  • 6
  • 14
  • 28
9
votes
1 answer

How to use custom templates in gii (using Yii 2)

I'm trying to find a way to use custom Gii templates for Yii 2, but looking at the missing documentation in the docs, I assume it's not possible yet? Or am I missing something?
Tubelight
  • 313
  • 3
  • 7
9
votes
11 answers

gii not working in yii

I am new in yii framework. In my site gii shows the error Error 403 You are not allowed to access this page. I set the gii in the config file like this 'gii'=>array( 'class'=>'system.gii.GiiModule', 'password'=>'test123', …
Semeena Kabeer
  • 149
  • 1
  • 2
  • 9
7
votes
4 answers

Create a CRUD from a database view using Gii in Yii2

I have generated a Model using gii of a mariadb view, which worked. Then trying use the gii CRUD generator for the model, I get the error The table associated with app\models\Future must have primary key(s). Which is perfectly understandable as…
Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
6
votes
2 answers

Yii - Inheriting From Custom Controller Class - Not Found

class SomeController extends Controller { public function actionIndex() { echo 'This is some controller'; } } class AnotherController extends SomeController { public function actionIndex() { …
Luke Wenke
  • 1,149
  • 2
  • 23
  • 43
5
votes
1 answer

Yii2 Gii Table Prefix

I allways setup table prefix - for this post lets say my prefix is abc_. So in common\config\main-local.php. I have: 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=database', 'username'…
G. Trennert
  • 561
  • 3
  • 12
  • 23
5
votes
4 answers

Web Process Permissions on Yii / Linux

I'm a noob and running through a Yii tutorial on AWS. So far I've been able to get everything up and running - including mysql connection. But now I'm using the Gii code generation tool to help create some model classes. In doing so, I'm getting the…
James S
  • 71
  • 1
  • 2
  • 4
4
votes
3 answers

Should I continue to rely on code generation to generate my models and CRUD?

As I delve a little deeper into Yii I'm now wondering if relying on Gii and Giix to generate my models and "admin" CRUD may be a crutch rather than a time-saving tool. Many times in the beginning stages of small projects it helps me get going more…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
4
votes
1 answer

fail to install mongodb in yii2 in windows7

I have just added this code in app\common\config\main.php dirname(dirname(__DIR__)) . '/vendor', 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], ], 'modules' => [ //... 'gii1' =>…
riariashn
  • 73
  • 5
4
votes
2 answers

Using Gii afer updating model files

I am learning Yii and I wonder if I generate model and CRUD files using Gii and then I modified these files manually then I changed my database should I run Gii again ? is it going to overwrite my changes in the model files ? if so what is the best…
zac
  • 4,495
  • 15
  • 62
  • 127
4
votes
1 answer

Yii2 - Saving multiple related ActiveRecord models in one form

Here is the table structure: Table BaseTable id (primary key) INT description VARCHAR(255) Table ChildTable id (primary key)(foreign key reference to BaseTable) INT child_property VARCHAR(255) It's a inheritance relation in…
Elliot Li
  • 452
  • 1
  • 5
  • 17
3
votes
5 answers

Yii can't start gii

I am developing website with PHP Yii Framework and I am now stack, I need to start gii, but I can't do this. when i type www.example.com/index.php/gii or www.example.com/gii it gives me this error : /gii/default/login // <- website redirects to…
Irakli
  • 1,151
  • 5
  • 30
  • 55
3
votes
1 answer

reset() expects parameter 1 to be array, integer given in Gii after update Yii version

After updating Yii to 1.1.20 I get the error reset() expects parameter 1 to be array, integer given when clicking the diff option in Model generator. I found the function in…
e-israel
  • 623
  • 10
  • 30
1
2 3
10 11