how to add downloaded extension to yii 1.11?
Asked Answered
N

2

7

can any one tell me how to add extension to my yii? i googled and downloaded Bootstrap 0.9.8 extension and followed the steps described in it but it not working for me. am using Ubuntu , can you please explain step by step am just beginner.

and i don't know how to add extension to yii

Nadene answered 24/9, 2012 at 11:13 Comment(3)
Please answer: 1. Your Ubuntu version? 2. Show url where U got bootstrap; 3. Show url with instruction;Sephira
not working for me won't help you get any help !!Dorathydorca
1.ubuntu 10.04 2. cniska.net/yii-bootstrap/setup.html#configNadene
F
5

@raghulrnair, assuming that you have some basic knowledge of yii. If not then read the Yii doc http://www.yiiframework.com/doc/guide/1.1/en/quickstart.what-is-yii

explaining it in conjunction with http://www.cniska.net/yii-bootstrap/setup.html#setup


1) Download the bootstrap extension, and unzip it into "protected/extensions/bootstrap". Once this step is done, then you must see following folders.

protected/extensions/bootstrap/assets
protected/extensions/bootstrap/gii
protected/extensions/bootstrap/components
protected/extensions/bootstrap/lib
protected/extensions/bootstrap/widgets

2) "Application Configuration" plays important role when installing extensions. By default this configuration will be in a php file (i.e protected/config/main.php )


3) Simply edit that file and search for "preload". if found then add "bootstrap" to that array

'preload'=>array( 'log', 'bootstrap'),

if not found,

'preload'=>array('bootstrap'),

4) Now Search for "components", then add bootstrap to that array like below

'components'=>array(
    .....
    'bootstrap'=>array(
        'class'=>'ext.bootstrap.components.Bootstrap',
    ),
),

5) If you want to auto generate bootstrap code ( crud, views, models etc.. ) follow this step. ( This is optional if you don't want ) add bootstrap to gii in 'modules' configuration.

'modules'=>array(
    .....
    'gii'=>array(
        .....
        'generatorPaths'=>array(
            'bootstrap.gii',
        ),
    ),
),

6) Your configuration is done. SETUP IS DONE.


7) Start coding using bootstrap in your views or use gii to generate code.

Many examples are given at http://www.cniska.net/yii-bootstrap/

one example, If you want to display a menu, then edit the view file and add this code.

<?php $this->widget('bootstrap.widgets.TbMenu', array(
    'type'=>'tabs', // '', 'tabs', 'pills' (or 'list')
    'stacked'=>false, // whether this is a stacked menu
    'items'=>array(
        array('label'=>'Home', 'url'=>'#', 'active'=>true),
        array('label'=>'Profile', 'url'=>'#'),
        array('label'=>'Messages', 'url'=>'#'),
    ),
)); ?>

8) Thats it.

Farrel answered 25/9, 2012 at 7:39 Comment(0)
H
1

Link to download bootstrap: http://www.yiiframework.com/extension/bootstrap

Assign permissions to extensions/bootstrap that you uncompressed:

chmod 755 bootstrap
Help answered 17/3, 2016 at 15:0 Comment(1)
While the link you provided may answer the question it is best to put the essential parts of your solution directly in your answer in case the link expires in the future.Bravo

© 2022 - 2024 — McMap. All rights reserved.