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
2
votes
5 answers

Gii: Class does not exist or has syntax error

I am trying to generate CRUD in yii2 using Gii. I have created a model class using Gii and it is created successfully. But When I try to create CRUD, it gives the following error: Class 'app\models\UserRoles' does not exist or has syntax…
Saani
  • 791
  • 7
  • 28
  • 68
2
votes
2 answers

Yii2 GridView implement Filter and Sort for Values for related Table of foreign Table

I have 3 Tables: CREATE TABLE tabCve ( intCveID INTEGER NOT NULL AUTO_INCREMENT, strNumber VARCHAR(20) NOT NULL, fltScore FLOAT(0), strDescription TEXT, datImported DATETIME NOT NULL DEFAULT NOW(), intCvePhaseID INTEGER, …
bnu
  • 269
  • 6
  • 16
2
votes
1 answer

Gii Model Generator generates a CDbException

I am trying to create a simple web application using yii. I have install WAMP 2.5 and yii 1.1.x. I have also created a skeleton application called yiitest. I have also created a database with mysql called yiitest which has a table called persons and…
user908759
  • 1,355
  • 8
  • 26
  • 48
2
votes
0 answers

Create relations in Yii automatically

I am newbie in Yii framework, I am facing problem for creating relations in the model using Gii, I have already established foreign key with my tables in database but still automatic relations are not generated. Any one knows how to solve the…
Codelord
  • 1,120
  • 2
  • 10
  • 21
2
votes
1 answer

calling gii Yii Framework dynamically

i am new to Yii Framework and i am trying to call the gii model generator dynamically from code, i cant find any sample to do this. So is there any way to call model generators and CRUD generator dynamically ?
Mothana
  • 41
  • 10
2
votes
3 answers

yii 2: gii index page loading issue

I am using Yii 2.. In my main-local.php file: 'modules' => [ 'debug' => 'yii\debug\Module', 'gii' => 'yii\gii\Module', ], 'gii' => [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['127.0.0.1', '::1', '50.62.10.149',…
user2696691
  • 91
  • 3
  • 11
2
votes
1 answer

Yii generate a model file using php code instead of gii tool

I'm having real problems with the following topic: I'm creating a social network using Yii framework and for each user I'm generating a bunch of DB tables that start with the user id, so a DB table looks like: 13_my_firends. The point is that by…
Ares Draguna
  • 1,641
  • 2
  • 16
  • 32
2
votes
2 answers

Yii: How to create crud operations for a model in a module?

There is a model(Message) located in message module. How can I create crud operations for this model outside of the module. Simply I want to create a crud operation (not in module), but my model is located in message module model directory. First…
hpaknia
  • 2,769
  • 4
  • 34
  • 63
2
votes
1 answer

Yii - Gii module does support foreign relationship?

I m new in Yii i want to know about the gii does it support for relationship for tables ?
John Smith
  • 21
  • 1
2
votes
1 answer

Gii not detecting mysql tables in model creator

From config/main.php : 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=testdb', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', ), When I use the…
Luke Wenke
  • 1,149
  • 2
  • 23
  • 43
2
votes
3 answers

Yii $this->redirect() is not working in action method

I have created one module using Giix Component. When i am performing create or update action, it renders create and update view properly. But after submitting form, it again calls same create or update method with request data and after calling save…
Silicon
  • 51
  • 1
  • 2
  • 3
2
votes
1 answer

how to use gii generator with modules in yii framework?

i am using the gii generator to create a module. the issue is when i try to create a form or some model for that module... i can't tell it to generate those files in that module... it only does it in the main application folders. any ideas? thanks.
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337
2
votes
1 answer

Crud for existing model in YII

I am trying to create CRUD for my model classed generated automatically by GII. Classes are stored like models/entity/Article.php. When i try to Gii generator put as class name models.entity.SomeClass or entity.SomeClass it doesn`t work. The gii…
Aleš
  • 783
  • 3
  • 7
  • 16
2
votes
3 answers

gii 404 error. Unable to use Gii

Following http://www.yiiframework.com/doc/blog/1.1/en/prototype.scaffold tutorial, it mentions to add some code to /blog/protected/config/main.php return array( ...... 'import'=>array( 'application.models.*', …
Gravy
  • 12,264
  • 26
  • 124
  • 193
2
votes
2 answers

Custom form element name attributes on CForm Yii Framework

I am using CModel (Gii specifically) to generate forms for my Yii application. I have a problem with how it names the name="" attributes of my form elements. They look exactly like my table fields on my DB. So, for a table like: Users. I get a form…
Sthe
  • 2,575
  • 2
  • 31
  • 48
1 2
3
10 11