[Extension] Yiistrap

Hi,

How can in include css file in my project?

I use yiistrap and use this code in main.php:




<?php Yii::app()->bootstrap->register(); ?>

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/style.css" />



but in client side, i see thi code:


<link rel="stylesheet" type="text/css" href="/ali/themes/reza/css/style.css" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css" href="/ali/assets/7b69d932/css/bootstrap.css" />

<link rel="stylesheet" type="text/css" href="/ali/assets/7b69d932/css/bootstrap-responsive.css" />

<link rel="stylesheet" type="text/css" href="/ali/assets/7b69d932/css/yiistrap.css" />



i want customize some class(like body) and yiistrap override this!

how can i do?

update

I can’t undrestand but when i change this code:




<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/style.css" />

<title><?php echo CHtml::encode($this->pageTitle); ?></title>



to this:




<title><?php echo CHtml::encode($this->pageTitle); ?></title>

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/style.css" />



thats promlem fixed!

I got it working by changing TbHtml::button to TbHtml::linkButton

Hi, i’m new to yiistrap and i’ve been trying to find a documentation with the parameters available for the Navbar widget with no success, my problem is the following:

with this code i dont see the navigation bar but the name of the app




<?php $this->widget('bootstrap.widgets.TbNavbar',array(

	'brandLabel' => '',

	'display' => null, // default is static to top

    'items'=>array(

        array(

            'class'=>'bootstrap.widgets.TbNavbar',

            'items'=>array(

                array('label'=>'Home', 'url'=>array('/site/index')),

                array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),

                array('label'=>'Contact', 'url'=>array('/site/contact')),

                array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),

                array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

            ),

        ),

    ),

)); ?>



and when i go to the other views of the site, like index.php?r=site/contact, i get a CExeption "TbActiveForm"."type" not defined

and it shows the error in the following lines of CWidgetFactory.php




161         foreach($properties as $name=>$value)

162             $widget->$name=$value;

163         return $widget;



i would really appreciate your help

Also if there is a complete documentation available i could really use the link xD

and by the way you are doing a great work with your extensions!

Thinking about switching to Yiistrap. Could not find this in the forums. Does anyone know if yiistrap supports scaffolding similar to twitter Bootstrap?

Thanks,

Brandon

I think you problem might be that for you dropdown menu you are also using tbNavbar. Try changing the class of the droptdown menu to tbNav.


<?php $this->widget('bootstrap.widgets.TbNavbar',array(

        'brandLabel' => '',

        'display' => null, // default is static to top

    'items'=>array(

        array(

            class'=>'bootstrap.widgets.TbNav',

            'items'=>array(

                array('label'=>'Home', 'url'=>array('/site/index')),

                array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),

                array('label'=>'Contact', 'url'=>array('/site/contact')),

                array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),

                array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

            ),

        ),

    ),

)); ?>

Hi,

thanks for this valuable extension. I would like to ask if TbHtml::customActiveControlGroup is supposed to render validation errors. I posted also more concrete question in separate thread here. Thank you for answer.

Note that I solved the below issue. Follow the link in the post to see how I did it.

Hi,

I would like to append to the class of the prepend and append option of the textFieldControlGroup. I have a more complete description of what I’m trying to achieve here.

Looking at the API code it seems that it can be done by setting HTMLOptions for the prepend and append option itself but it is not clear to me whether it can be done or how to do so.

Any assistance will be appreciated.

Solution found and mentioned here. Feel free to add it into yiistrap if needed.

Hello Yii users!

Could anyone solve the second point. I´m dealing with the same problem and i´m stuck…

Thanks and cheers!

Lukatone

Please see the update to this. The original solutions proposed were in essence hacks. The correct solution has now been posted and should be included in YiiStrap in the tbActiveForm class.

I will submit it to the authors of YiiStrap for inclusion.

Hi All,

Why if I get rid of ControlGroup on each element doesn’t load jquery.yiiactiveform.js file.

The validation only work if I have ControlGroup on each element.

on main layout.

<?php $this->renderPartial(’_login’, array(‘model’=>$model)); ?>

_login file.


<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(

	'id'=>'login-form',

	'action' => $this->createUrl('user/login'),

	'enableClientValidation'=>true,

 	'htmlOptions'=>array('class'=>'well'),

	'clientOptions'=>array(

		'validateOnSubmit'=>true,

	),

	

)); ?>

<!-- your form elements here -->

  	<?php echo $form->textFieldControlGroup($model, 'username', 

    	    array('placeholder' => 'Email', 'size' => TbHtml::INPUT_SIZE_SMALL)); ?>


    <?php echo $form->passwordFieldControlGroup($model, 'password', 

    	array('placeholder' => 'Password', 'size' => TbHtml::INPUT_SIZE_SMALL)); ?>


    <?php echo $form->checkBoxControlGroup($model, 'rememberMe', 

		array('label' => 'Remember me')); ?>

    <?php echo TbHtml::submitButton('Submit'); ?>

<?php $this->endWidget(); ?>



Also I tried to add renderPartial(, false, true) and it load twice bootstrap files.

Can anyone explain me, why is happen this way.

Best Regards.

Hi!

Someone has an example of TbCollapse?

Tks!

I’m using TbGridView, but the row search does not work! How do I activate this feature?

Hi all,

I’ve been struggling for many hours with a crazy bootstrap issue.

Your help would be very much appreciated.

Context :

I am using a few widgets with those standard icons (glyphicons) provided @ ext/bootstrap/assets/images. It works fine (sample code below) .

Then, I thought : let’s customize the icons, shoul be child play. Actually, the process is quite complicated and needs some css overriding, but that’s not the issue.

Issue :

The thing is, whatever I do to those damned CSS files @ ext/bootstrap/assets/css, nothing would change.

Worse thant that : I removed the whole content of the assets folder, and my web site is still displaying the same pages with the same bootstrap style.

Of course, I did reset firefox, reset wamp, tried chrome, reset the server (my pc) and even upgraded and adapted to yiistrap, and I still get the same issue.

Could someone please give me a clue on :

  1. How can bootstrap extensions work without their css files (at least those i spotted, css and LESS)

  2. Then, if anyone succeeded in customizing the icons, I’m very interested in guidance there too

Thanks people, hope you’ll find this more entertaining than I do.

Here’s a sample of my main.php layout file.

I’m using a bootstrap widget with icons :


	

<?php $this->widget('bootstrap.widgets.TbNav', array(

		'type'=>'list',

		'items'=>array(

			TbHtml::menuDivider(),

			array('label'=>t('PROFILE BUSINESS')),

			array('label'=>t('Login'), 'icon'=>'user', 'url'=>array('/home/login'), 'visible'=>Yii::app()->user->isGuest),

			array('label'=>t('Register'), 'icon'=>'pencil', 'url'=>'#', 'visible'=>Yii::app()->user->isGuest),

			array('label'=>t('Logout').' ('.Yii::app()->user->name.')', 'icon'=>'off', 'url'=>array('/home/logout'), 'visible'=>!Yii::app()->user->isGuest),

			array('label'=>t('Profile'), 'icon'=>'user', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),

			array('label'=>t('Profile settings'), 'icon'=>'cog', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),

			array('label'=>t('ADDITIONNAL FEATURES')),

			array('label'=>t('Messages'), 'icon'=>'envelope', 'url'=>'#', 'visible'=> !Yii::app()->user->isGuest),

			array('label'=>t('Suggestions'), 'icon'=>'flag', 'url'=>'#', 'visible'=> !Yii::app()->user->isGuest),

			array('label'=>t('Announcements'), 'icon'=>'home', 'url'=>array('/home'),

		)),

	)); ?>




Believe me, this is displaying real bootstrap style although no css is available…

Is a Bootstrap 3.0 version planned?

How do I render a labelTD in a YiiWheels GridView?

How to set ‘url’ for image in TbHtml::medias ? Now it is “#”.

How to migrate from yii-bootstrap to YiiStrap?

<br /><br /><br />

Someone?

Hello Chris,

I just want to know if you have a downloadable documentation for yiistrap and yiiwheels? Or just examples how to use those… If you have please could you tell me how to get it…