Issue #262 new

yii-bootstrap generator is not working

nour maybar avatarnour maybar created an issue

I have followed below instructions to set main.config (the same instruction mentioned in extenstion setup)

// Define a path alias for the Bootstrap extension as it's used internally. // In this example we assume that you unzipped the extension under protected/extensions. Yii::setPathOfAlias('bootstrap', dirname(FILE).'/../extensions/bootstrap');

return array( 'theme'=>'bootstrap', // requires you to copy the theme under your themes directory 'modules'=>array( 'gii'=>array( 'generatorPaths'=>array( 'bootstrap.gii', ), ), ), 'components'=>array( 'bootstrap'=>array( 'class'=>'bootstrap.components.Bootstrap', ), ), );

but when i try to open gii I get the following error:

Alias "gii.GiiModule" is invalid. Make sure it points to an existing PHP file and the file is readable.

I noticed that the provided configuration instruction do not contain the following text in gii module array in the main.config file

'modules' => array(
        'gii' => array(
**            'class' => 'system.gii.GiiModule',
            'password' => 'gii',**
        )
    )

which caused the problem of error above. so I updated my main.config to be like below:

    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'gii',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
            'generatorPaths' => array(
                'bootstrap.gii',),
        ),

the gii module worked fin and i can generate models,views,controller and so on but they are not generated with bootstrap widgets. so how can i use yii-bootstrap and gii to generate views with bootstrap widgets ? Thanks in advanced.

Comments (5)

  1. liu yuan

    you must define a wrong 'bootstrap' alias ,it should be defined as follows: Yii::setPathOfAlias('bootstrap', dirname(FILE).'/../extensions/bootstrap/');
    especially the '/' at the first place you shouldn't ingore

  2. riregi

    i try change code with sample but i this error Alias "gii.GiiModule" is invalid. Make sure it points to an existing PHP file and the file is readable.
    My $path is wrong "....../htdocs/testing/protected/modules/gii/GiiModule" not exist !!

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.