Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

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

Open
totpero opened this issue Jun 1, 2015 · 6 comments
Open

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

totpero opened this issue Jun 1, 2015 · 6 comments

Comments

@totpero
Copy link

totpero commented Jun 1, 2015

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
Copy link
Contributor

Quexer69 commented Jun 1, 2015

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

@totpero
Copy link
Author

totpero commented Jun 1, 2015

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
Copy link
Member

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
Copy link
Contributor

Quexer69 commented Jun 1, 2015

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
Copy link
Author

totpero commented Jun 1, 2015

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
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants