gii

Why can't I create CRUD with GII in Yii2

时光总嘲笑我的痴心妄想 提交于 2020-01-06 18:37:10
问题 I have made the view table with function "join" in sql. but when I try to generate the view table with gii, it was said that "Table associated with Rangkuman must have primary key", and I have made primary key with table that associated with Rangkuman. But still be like this picture Here is Rangkuman model <?php namespace app\models; use Yii; /** * This is the model class for table "rangkuman". * * @property string $Fakultas * @property string $Departemen * @property string $KodeMayor *

Yii2 gii crud error Class 'app\models\Yii' not found

左心房为你撑大大i 提交于 2020-01-03 20:56:10
问题 I just installed yii2 advanced template, I created a model News and now I want to create the Crud (with gii), but when I click 'preview' I get this error. I did not change anything else in the advanced template. I'm using wamp PHP Fatal Error – yii\base\ErrorException Class 'app\models\Yii' not found 1. in C:\wamp\www\advanced\backend\models\News.php at line 44 2. in C:\wamp\www\advanced\vendor\yiisoft\yii2-gii\generators\crud\default\search.php – yii\gii\generators\crud\Generator:

Yii2 oracle 11g gii relations timeout

烂漫一生 提交于 2019-12-25 07:47:24
问题 I have: Windows Server 2012 R2 wampserver 3.0.6 64bit yii2 php_oci8_12c enabled, php_pdo_oci enabled, oracle instantclient-basiclite-windows.x64-12.1.0.2.0 System Path defined according added mod_fcgid 2.3.9 to Apache added oci8 2.0.12 Thread Safe x64 for PHP 5.6 (replaced old php_oci8_12c.dll) I see PDO for Oracle in phpinfo. I have a db_o.php config file: return [ 'class' => 'yii\db\Connection', 'dsn' => 'oci:dbname=//SOME_IP_ADDRESS:PORT/YOUR_SID;charset=UTF8', 'username' => '', 'password'

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

牧云@^-^@ 提交于 2019-12-24 02:44:08
问题 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 doing this, I cannot generate a certain model using the gii tool, and I really need some models for this tables to make some relations to avoid inner joins, so I guess the problem is like this: -> How can I create a model file using php or Yii code

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

梦想的初衷 提交于 2019-12-24 02:44:03
问题 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 doing this, I cannot generate a certain model using the gii tool, and I really need some models for this tables to make some relations to avoid inner joins, so I guess the problem is like this: -> How can I create a model file using php or Yii code

Yii generate model without Gii

做~自己de王妃 提交于 2019-12-23 03:12:16
问题 I need to generate a model file without the use of Gii. Are there any command Yii? $table = "myTable"; Yii::app()->generateModel($table); // ? 回答1: Perhaps is officially deprecated, you can generate code with Yii Command Line Tools I have tested it with Yii 1.1.17. First you need to create a new file on protected/commands called for example NewmodelCommand.php to create a new yii command. We need to avoid to use shell interactive tool and call command directly from our code in controllers,

Yii generate model without Gii

牧云@^-^@ 提交于 2019-12-23 03:12:03
问题 I need to generate a model file without the use of Gii. Are there any command Yii? $table = "myTable"; Yii::app()->generateModel($table); // ? 回答1: Perhaps is officially deprecated, you can generate code with Yii Command Line Tools I have tested it with Yii 1.1.17. First you need to create a new file on protected/commands called for example NewmodelCommand.php to create a new yii command. We need to avoid to use shell interactive tool and call command directly from our code in controllers,

Create a CRUD from a database view using Gii in Yii2

寵の児 提交于 2019-12-21 12:58:51
问题 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 the the view does not have a PK. I found some advice that says to add a primaryKey function to the model so I tried public function primaryKey() { return 'id'; } With id being the column name which is actually the PK in the underlying table, which is

does gii automatically create relations for generated models?

牧云@^-^@ 提交于 2019-12-19 10:44:20
问题 I'm new to Yii here. In the documentation, it seems to imply that gii will create the relations for related models. But when using gii to generate models from DB, it doesn't seem to be the case. For example, I have a user table and a profile table with a column "user_id INTEGER DEFAULT 0", but the relations array is empty in the generated model. Did I do something wrong, or gii just doesn't automatically recognize the relations? Thanks, 回答1: Gii will create relations for MyISAM tables if you

gii not working in yii

南楼画角 提交于 2019-12-18 21:21:14
问题 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', 'ipFilters'=>array('192.168.0.101','127.0.0.1','::1'), ), still it show the error 回答1: This is the only line that worked for me: 'ipFilters'=>array($_SERVER['REMOTE_ADDR']), 回答2: You may set... 'ipFilters' => false From the docs http://www.yiiframework.com/doc/api/1.1