Yii Framework Forum: [EXTENSION] Bootstrap - Yii Framework Forum

Jump to content

  • (45 Pages)
  • +
  • « First
  • 33
  • 34
  • 35
  • 36
  • 37
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Bootstrap Bringing together Yii and Twitter Bootstrap Rate Topic: ***** 23 Votes

#681 User is offline   yiqing95 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 598
  • Joined: 27-December 10
  • Location:china

Posted 03 September 2012 - 08:27 PM

View PostLothor, on 03 September 2012 - 07:24 AM, said:

..
// I created a new property.

/**
 * @var boolean to register the Bootstrap in AJAX requests
 * Defaults to true.
 */
public $ajaxCssImport = true;

// And added the following conditional
if(($this->ajaxCssImport && Yii::app()->request->isAjaxRequest) || !Yii::app()->request->isAjaxRequest ) {
    // Prevents the extension from registering scripts and publishing assets when ran from the command line.
    if (Yii::app() instanceof CConsoleApplication)
	    return;

    if ($this->coreCss !== false)
	    $this->registerCoreCss();

    if ($this->responsiveCss !== false)
	    $this->registerResponsiveCss();

    if ($this->yiiCss !== false)
	    $this->registerYiiCss();
}

if ($this->enableJS !== false)
	$this->registerCoreScripts();


In main.php

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


With that solved my problem.


..

The CSS files are not loaded, but the AJAX code that is generated by the view that is being called, is not.

So below is outside the conditional parole that I created.

if ($this->enableJS !== false)
	$this->registerCoreScripts();



:lol: i agree , it seems your solution is better !
0

#682 User is offline   RSfTDL 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 89
  • Joined: 22-June 12

Posted 04 September 2012 - 02:03 PM

Hello guys!

Someone know if its possible to change the location of the .css files in the html code ? I'm testing seo+bootstrap and i noticed that the css used by bootstrap are always loaded in first place on the html code and after the seo extension.

<!doctype html>
<html>
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/9b5b5612/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/9b5b5612/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/563dbbc7/highlight.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/css/styles.css" />
<script type="text/javascript" src="/yii-bootstrap/assets/2c3c7d1a/jquery.js"></script>
<script type="text/javascript" src="/yii-bootstrap/assets/9b5b5612/js/bootstrap.js"></script>
<title>...</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-US" />
<meta name="description" content="..." />
...


What i want to know is if its possible to put the meta's first?
0

#683 User is offline   Lothor 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 05-August 11
  • Location:Brazil

Posted 04 September 2012 - 03:13 PM

View PostRSfTDL, on 04 September 2012 - 02:03 PM, said:

Hello guys!

Someone know if its possible to change the location of the .css files in the html code ? I'm testing seo+bootstrap and i noticed that the css used by bootstrap are always loaded in first place on the html code and after the seo extension.

<!doctype html>
<html>
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/9b5b5612/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/9b5b5612/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/assets/563dbbc7/highlight.css" />
<link rel="stylesheet" type="text/css" href="/yii-bootstrap/css/styles.css" />
<script type="text/javascript" src="/yii-bootstrap/assets/2c3c7d1a/jquery.js"></script>
<script type="text/javascript" src="/yii-bootstrap/assets/9b5b5612/js/bootstrap.js"></script>
<title>...</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-US" />
<meta name="description" content="..." />
...


What i want to know is if its possible to put the meta's first?

The CSS are being placed on top of TAG "title", try putting the TAG "title" below the meta tags.
0

#684 User is offline   RSfTDL 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 89
  • Joined: 22-June 12

Posted 04 September 2012 - 04:51 PM

View PostLothor, on 04 September 2012 - 03:13 PM, said:

The CSS are being placed on top of TAG "title", try putting the TAG "title" below the meta tags.


You're right Lothor, thanks for the tip!

Btw, I'm using the extension SEO done by Chris, if someone has the same problem, can be solved by changing line 82 in file SeoHead.php, placing it at the end of renderContent() method.
0

#685 User is offline   Lothor 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 05-August 11
  • Location:Brazil

Posted 05 September 2012 - 12:25 PM

View PostRSfTDL, on 04 September 2012 - 04:51 PM, said:

You're right Lothor, thanks for the tip!

Btw, I'm using the extension SEO done by Chris, if someone has the same problem, can be solved by changing line 82 in file SeoHead.php, placing it at the end of renderContent() method.

I do not know the extent of SEO, but if not available, you can try to parameterize it.
0

#686 User is offline   Nasreddine 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 06-October 11

Posted 07 September 2012 - 02:00 AM

Hi,
U have two questions :
I have a problem with Gii generator. It doesn't generate new form code based on Bootstrap.
Is there a theme for this extension ?
0

#687 User is offline   toshex 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 03-September 12

Posted 07 September 2012 - 04:46 PM

Ok is it me, or does the ACTIVE class don't get appended to the dropdown menu parent in a navbar?

I have 2 dropdowns in my navbar, and none has active class when it's children are active.

Solution anyone?


Here is my navbar code.
gist.github.com/3669973
0

#688 User is offline   SergeC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 06-September 12

Posted 08 September 2012 - 10:22 AM

Hi.

How can I add date input
<input type="date" name="checkin-date">
with bootstrap?

Thanks.
0

#689 User is offline   Sage 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 29-August 12
  • Location:California, USA

Posted 11 September 2012 - 05:30 PM

Thanks for the detailed explanation!



View PostDon Felipe, on 31 August 2012 - 02:02 AM, said:

It's a little bit tricky to get there. Setting and alternate or no label for form elements is different from setting it for buttons, for instance. Here's how:
array(
    'labelOptions'=>array('label'=>false),
    'style'=>'display:block; margin-top:10px;', //see comment below
)

As you can see you have to add another array 'labelOptions' inside the one for 'htmlOptions'. Unfortunately, in a vertical-form the label-less drop down will float around the previous form element unless you add the 'display:block'.

Just in case, depending on the form element ($form->...) there are a couple of options that can be added inside the array for htmlOptions:

arrays: labelOptions, prependOptions, appendOptions, hintOptions, errorOptions, and captchaOptions,
string: hint, prepend, append

All the names are self-explanatory. It may look complicated on first view but it makes perfect sense. Adding additional arrays like that gives you the options to set different styles for all the different elements (label, input, appended input, hint, etc).

Hope it helps.

0

#690 User is offline   Daniel Chen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 22-August 12

Posted 11 September 2012 - 07:04 PM

Hello,

I'm create Navbar menu bar (hardcode menu item) as below:

$this->widget('bootstrap.widgets.TbNavbar', array(
  'id'=>'tbNavbar1',
  ..    		
  'items'=>array(
      array(
        'class'=>'bootstrap.widgets.TbMenu',
           'items'=>array(
            	array('label'=>'Menu1', 'url'=>'#', 'items'=>array(
            		array('label'=>'submenu1', 'url'=>'#'),
            		array('label'=>'submenu2', 'url'=>'#'), 
            	)),


Now I would like to build the dynamic sub-menu item from database but it doesn't work (return empty submenu items)

array('label'=>'Menu1', 'url'=>'#', 
     'items'=>Yii::app()->session['submenu'],
),

Thanks for help
1

#691 User is offline   Don Felipe 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 117
  • Joined: 02-January 11
  • Location:Saigon, Vietnam

Posted 12 September 2012 - 02:12 AM

View PostDaniel Chen, on 11 September 2012 - 07:04 PM, said:

Hello,

I'm create Navbar menu bar (hardcode menu item) as below:

$this->widget('bootstrap.widgets.TbNavbar', array(
  'id'=>'tbNavbar1',
  ..    		
  'items'=>array(
      array(
        'class'=>'bootstrap.widgets.TbMenu',
           'items'=>array(
            	array('label'=>'Menu1', 'url'=>'#', 'items'=>array(
            		array('label'=>'submenu1', 'url'=>'#'),
            		array('label'=>'submenu2', 'url'=>'#'), 
            	)),


Now I would like to build the dynamic sub-menu item from database but it doesn't work (return empty submenu items)

array('label'=>'Menu1', 'url'=>'#', 
     'items'=>Yii::app()->session['submenu'],
),

Thanks for help


No matter where your submenu comes from (session, controller) you have to make sure it's a valid multidimensional array hence an array with sub-arrays that contain label, url, etc. Here's an example with a manually and quickly added array (don't have time to do more sorry):

<?php
$submenu = array();
$submenu[] = array('label'=>'submenu1', 'url'=>'#');
$submenu[] = array('label'=>'submenu2', 'url'=>'#');

$this->widget('bootstrap.widgets.BootNavbar', array(
    'type'=>'inverse',
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.BootMenu',
            'items'=>array(
                array('label'=>'Menu1', 'url'=>'#', 'items'=>$submenu),
            ),
        ),
    ),
)); ?>


Hope it helps. Not sure if adding this array (submenu) to the php session is the right way to do this.
However, check out this link for more info about adding arrays to php session.
1

#692 User is offline   Daniel Chen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 22-August 12

Posted 12 September 2012 - 11:36 AM

View PostDon Felipe, on 12 September 2012 - 02:12 AM, said:

No matter where your submenu comes from (session, controller) you have to make sure it's a valid multidimensional array hence an array with sub-arrays that contain label, url, etc. Here's an example with a manually and quickly added array (don't have time to do more sorry):

<?php
$submenu = array();
$submenu[] = array('label'=>'submenu1', 'url'=>'#');
$submenu[] = array('label'=>'submenu2', 'url'=>'#');

$this->widget('bootstrap.widgets.BootNavbar', array(
    'type'=>'inverse',
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.BootMenu',
            'items'=>array(
                array('label'=>'Menu1', 'url'=>'#', 'items'=>$submenu),
            ),
        ),
    ),
)); ?>


Hope it helps. Not sure if adding this array (submenu) to the php session is the right way to do this.
However, check out this link for more info about adding arrays to php session.


Hi Don Felipe,

I'm build the multidimensional array with structure as your guide. It works well.

Thank you very much.

Regards,
0

#693 User is offline   kingsol 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 09-January 11

Posted 12 September 2012 - 11:48 AM

Greetings... I am converting the views for yii-user and yii-rights to leverage this module... it's starting to look really nice. (happy to contribute back for anyone that would want it).

I am having a little trouble with converting one item that when rendered with the CMenu widget, works, but I can not seem to get it to work with TbButton.

Here is the original code from the yii-user module view:

$this->menu=array(
    array('label'=>UserModule::t('Delete User'), 'url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>UserModule::t('Are you sure to delete this item?')))
);


Here is how I currently have it in my theme/view:

$this->widget('bootstrap.widgets.TbButton', array(
		'buttonType'=>'link',
		'icon'=>'trash',
		'type'=>'danger',
		'label'=>UserModule::t('Delete User'), 
		'url'=>array('delete','id'=>$model->id),
		'htmlOptions'=>array('confirm'=>UserModule::t('Are you sure to delete this item?')),
		'size'=>'Large'
		));


It does the prompt,but then goes to the URL (which requires a POST not a GET). Any advice?

I also tried it as a submit link, but got this error (and have this error when converting rights to use the TbGridView as well... thoughts? "Uncaught TypeError: Cannot call method 'submitForm' of undefined "

Many Thanks. And Chris -> Love this module and yii-rights... thank you for your constant contributions.
0

#694 User is offline   DanEdge 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 06-July 11

Posted 12 September 2012 - 06:54 PM

Hi Folks,
I'm getting this error with the latest version of the bootstrap extension when using the TbMenu widget
Property "TbMenu.itemCssClass" is not defined

Everything worked fine before I upgraded to the latest version of the extension and if I comment out the two relevant lines in TbBaseMenu everything seems to work as expected (so far, anyway).
if ($this->itemCssClass !== null)
   $classes[] = $this->itemCssClass;

Also, I don't get the error on my local machine, only on a live server. Does anyone have any ideas what's going on?
0

#695 User is offline   yiistudent 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 15-November 10

Posted 12 September 2012 - 10:16 PM

how to make collapse sub menu on nav list?



0

#696 User is offline   alanselvam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 02-May 11

Posted 13 September 2012 - 11:59 AM

View PostChris83, on 26 September 2011 - 04:09 AM, said:

Hello,

This is the discussion thread for my latest extension, Bootstrap.

What is Bootstrap?
Bootstrap is a toolkit to kickstart development of web applications. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation and more. Bootstrap has been developed by Twitter, it is open source and can be found on Github.

Why an extension?
After trying out Bootstrap I immediately decided that it was time to write an extension to allow developers to easily implement this awesome toolkit in their existing and upcoming Yii-projects.

Download the extension here:
http://www.yiiframew...sion/bootstrap/

Fork me Bitbucket:
https://bitbucket.or.../yii-bootstrap/

More about Bootstrap here:
http://twitter.github.com/bootstrap/

Try out the demo here:
http://www.cniska.ne...bootstrap/demo/

Enjoy!


Hi,

I am using your extension and it was wonderful. have u doubt on that.

I want load a form with checkBoxListRow with some checkboxes preselected. How to achieve? please let me know

<?php echo $form->checkBoxListRow($model, 'checkboxes', array(
'Option one is this and that—be sure to include why it\'s great',
'Option two can also be checked and included in form results',
'Option three can—yes, you guessed it—also be checked and included in form results',
), array('hint'=>'<strong>Note:</strong> Labels surround all the options for much larger click areas.')); ?>
0

#697 User is offline   spidaboy7 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 19-April 12
  • Location:Rwanda,Kigali

Posted 15 September 2012 - 10:12 PM

hello guys,i am new to yii, i am trying to use bootstrap but iam receive this error Alias "bootstrap.widgets.TbNavbar" is invalid. Make sure it points to an existing PHP file. whenever i try to use one of the widgets,i believe its a setting problem but i cant find where i am doing things wrong,here is my config/main.php
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
        'language'=>'en_us',
        'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
        'name'=>'CODEPAC',

        // preloading 'bootstrap,log' component
        'preload'=>array('bootstrap','log',),

        // autoloading model and component classes
        'import'=>array(
                'application.models.*',
                'application.components.*',

        ),

        'modules'=>array(
                // uncomment the following to enable the Gii tool
                'user'=>array(
                'debug'=>false,
                'userTable'=>'user',
                'translationTable'=>'translation',
                'mailer'=>'PHPMailer',
                'facebookConfig'=>array(
                        'appId'=>'142433968341',
                        'secret'=>'a9f79372e1f945c0e0b743d9be8939f1',
                        'domain'=>'localhost',
                        'status'=>true,
                        'xfbml'=>true,
                        'cookie'=>true,
                        'lang'=>'en_US',)
                ),
                 'avatar'=>array(),

                'profile' => array(
                'privacySettingTable' => 'privacysetting',
                'profileFieldTable' => 'profile_field',
                'profileTable' => 'profile',
                'profileCommentTable' => 'profile_comment',
                'profileVisitTable' => 'profile_visit',
                 ),
                 'role' => array(
                'roleTable' => 'role',
                'userRoleTable' => 'user_role',
                'actionTable' => 'action',
                'permissionTable' => 'permission',
                 ),

                'registration' => array(
                 ),


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

        ),

        // application components
        'components'=>array(
                'bootstrap'=>array(
                'class'=>'ext.bootstrap.components.Bootstrap',),
                'session'=>array(
                'sessionName'=>'SiteSession',
                'class'=>'CHttpSession',
'autoStart'=>true,
                ),
                 'cache'=>array('class'=>'system.caching.CFileCache'),
                        'user'=>array(
                        'class'=>'application.modules.user.components.YumWebUser',
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                         'loginUrl'=>array('//user/user/login'),
                ),
                // uncomment the following to enable URLs in path-format

                'urlManager'=>array(
                        'urlFormat'=>'path',
                        /*'rules'=>array(
                                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                        ),*/
                ),
                /*
                'db'=>array(
                        'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
                ),
                // uncomment the following to use a MySQL database
                */


                'db'=>array(
                        'connectionString' => 'mysql:host=localhost;dbname=codepacu',
                        'emulatePrepare' => true,
                        'username' => 'root',
                        'password' => 'rwinkwavu',
                        'charset' => 'utf8',
                        'tablePrefix'=>'',
                ),

                'errorHandler'=>array(
                        // use 'site/error' action to display errors
                                                                                                                                           
'errorAction'=>'site/error',
        ),
                'log'=>array(
                        'class'=>'CLogRouter',
                        'routes'=>array(
                                array(
                                        'class'=>'CFileLogRoute',
                                        'levels'=>'error, warning',
                                ),
                                // uncomment the following to show log messages on web pages
                                /*
                                array(
                                        'class'=>'CWebLogRoute',
                                ),
                                */
                        ),
                ),
        ),

        // application-level parameters that can be accessed
        // using Yii::app()->params['paramName']
        'params'=>array(
                // this is used in contact page
                'adminEmail'=>'eliemagambo@gmail.com',
        ),
        'import'=>array('application.modules.user.models.*',
        'application.models.*',
        'application.components.*',),
);
                                                           
                                                          


                                                                                                                                           

0

#698 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 16 September 2012 - 01:26 AM

Make sure your alias used in the views points to the right location - see here.

View Postspidaboy, on 15 September 2012 - 10:12 PM, said:

hello guys,i am new to yii, i am trying to use bootstrap but iam receive this error Alias "bootstrap.widgets.TbNavbar" is invalid. Make sure it points to an existing PHP file. whenever i try to use one of the widgets,i believe its a setting problem but i cant find where i am doing things wrong,here is my config/main.php
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
        'language'=>'en_us',
        'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
        'name'=>'CODEPAC',

        // preloading 'bootstrap,log' component
        'preload'=>array('bootstrap','log',),

        // autoloading model and component classes
        'import'=>array(
                'application.models.*',
                'application.components.*',

        ),

        'modules'=>array(
                // uncomment the following to enable the Gii tool
                'user'=>array(
                'debug'=>false,
                'userTable'=>'user',
                'translationTable'=>'translation',
                'mailer'=>'PHPMailer',
                'facebookConfig'=>array(
                        'appId'=>'142433968341',
                        'secret'=>'a9f79372e1f945c0e0b743d9be8939f1',
                        'domain'=>'localhost',
                        'status'=>true,
                        'xfbml'=>true,
                        'cookie'=>true,
                        'lang'=>'en_US',)
                ),
             	'avatar'=>array(),

                'profile' => array(
                'privacySettingTable' => 'privacysetting',
                'profileFieldTable' => 'profile_field',
                'profileTable' => 'profile',
                'profileCommentTable' => 'profile_comment',
                'profileVisitTable' => 'profile_visit',
             	),
             	'role' => array(
                'roleTable' => 'role',
                'userRoleTable' => 'user_role',
                'actionTable' => 'action',
                'permissionTable' => 'permission',
             	),

                'registration' => array(
             	),


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

        ),

        // application components
        'components'=>array(
                'bootstrap'=>array(
                'class'=>'ext.bootstrap.components.Bootstrap',),
                'session'=>array(
                'sessionName'=>'SiteSession',
                'class'=>'CHttpSession',
'autoStart'=>true,
                ),
             	'cache'=>array('class'=>'system.caching.CFileCache'),
                        'user'=>array(
                        'class'=>'application.modules.user.components.YumWebUser',
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                     	'loginUrl'=>array('//user/user/login'),
                ),
                // uncomment the following to enable URLs in path-format

                'urlManager'=>array(
                        'urlFormat'=>'path',
                        /*'rules'=>array(
                                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                        ),*/
                ),
                /*
                'db'=>array(
                        'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
                ),
                // uncomment the following to use a MySQL database
                */


                'db'=>array(
                        'connectionString' => 'mysql:host=localhost;dbname=codepacu',
                        'emulatePrepare' => true,
                        'username' => 'root',
                        'password' => 'rwinkwavu',
                        'charset' => 'utf8',
                        'tablePrefix'=>'',
                ),

                'errorHandler'=>array(
                        // use 'site/error' action to display errors
                                                                                                                                       	
'errorAction'=>'site/error',
        ),
                'log'=>array(
                        'class'=>'CLogRouter',
                        'routes'=>array(
                                array(
                                        'class'=>'CFileLogRoute',
                                        'levels'=>'error, warning',
                                ),
                                // uncomment the following to show log messages on web pages
                                /*
                                array(
                                        'class'=>'CWebLogRoute',
                                ),
                                */
                        ),
                ),
        ),

        // application-level parameters that can be accessed
        // using Yii::app()->params['paramName']
        'params'=>array(
                // this is used in contact page
                'adminEmail'=>'eliemagambo@gmail.com',
        ),
        'import'=>array('application.modules.user.models.*',
        'application.models.*',
        'application.components.*',),
);
                                                       	
                                                          


                                                                                                                                       	


0

#699 User is offline   DanEdge 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 06-July 11

Posted 16 September 2012 - 07:18 PM

View Postspidaboy, on 15 September 2012 - 10:12 PM, said:

hello guys,i am new to yii, i am trying to use bootstrap but iam receive this error Alias "bootstrap.widgets.TbNavbar" is invalid. Make sure it points to an existing PHP file. whenever i try to use one of the widgets,i believe its a setting problem but i cant find where i am doing things wrong,here is my config/main.php

Is that the only module you're having problems with? If so, I doubt it's a problem with your config. Try a different module to check, if you haven't already.

One thing to check; make sure you're calling 'TbNavbar' rather than 'TbNavBar' or something if you're using a Linux server as it's case sensitive. This exact thing happened to me not long ago and it was only obvious when I pushed to a live server since I develop on Windows (which isn't case sensitive).
0

#700 User is offline   Don Felipe 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 117
  • Joined: 02-January 11
  • Location:Saigon, Vietnam

Posted 16 September 2012 - 10:31 PM

View Postspidaboy, on 15 September 2012 - 10:12 PM, said:

hello guys,i am new to yii, i am trying to use bootstrap but iam receive this error Alias "bootstrap.widgets.TbNavbar" is invalid. Make sure it points to an existing PHP file. whenever i try to use one of the widgets,i believe its a setting problem but i cant find where i am doing things wrong,here is my config/main.php


It doesn't seem to be a problem with the extension (component) but the widget.
Make sure it's where it's supposed to be; e.g.

/path-to-webapp/protected/extensions/bootstrap/widgets/TbNavbar.php

Are you still using an older version/download of yii-bootstrap? Then you don't have TbNavbar.php but BootNavbar.php. That would result in above error message; or of course any type of misspelling. Good luck!
0

Share this topic:


  • (45 Pages)
  • +
  • « First
  • 33
  • 34
  • 35
  • 36
  • 37
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users