phundament / app

Dockerized Yii2 web application base
http://phundament.com
Other
310 stars 129 forks source link

Giiant->Model and Model->Generator TypeError: yii.gii is undefined #175

Open totpero opened 9 years ago

totpero commented 9 years ago

i have install phundament last version and if i try to generate model using giiant or model generator from admin i get this error:

TypeError: yii.gii is undefined

Quexer69 commented 9 years ago

Could you please paste the complete log output of this error?

totpero commented 9 years ago

I try to access my web app: http://localhost/app/web/index.php?r=gii/default/view&id=giiant-model and in firebug console i get his error: TypeError: yii.gii is undefined http://localhost/app/web/index.php?r=gii%2Fdefault%2Fview&id=giiant-model Line 486

This is happening because on the footer in the scripts is added this: yii.gii.autocomplete(... and the javascript with this function is not included.

schmunk42 commented 9 years ago

I'd also recommend to use the CLI generator, see also: https://github.com/schmunk42/yii2-giiant/blob/master/docs/generate-sakila-backend.md

Quexer69 commented 9 years ago

http://localhost/app/web/index.php?r=gii is accessible ?

if not, maybe Gii is not loaded in your application config.

Gii is only loaded in YII_ENV_DEV.

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][]    = 'gii';
    $config['modules']['gii'] = [
        'class'      => 'yii\gii\Module',
        'allowedIPs' => $allowedIPs
    ];
}

Additionally you may update


$allowedIPs = [
    '127.0.0.1',
    '::1',
    '192.168.*',
    '172.17.*'
];

But as schmunk42 said, better use the CLI generator.

totpero commented 9 years ago

but why is exist the "Code Generation" button in admin dashboard if is recommended to use CLI generator, if web interface don't works

schmunk42 commented 9 years ago

Good point ;) I wanted to remove that already, but the list is generated automatically by gii.

The project is not stable yet ... the web-interface should work, but it's very likely that there are issues at the moment.

But give the CLI a try, it's a bit of a hurdle in the first place, but it will increase your development speed and reduce your error rate.