[Extension] Yiistrap

Hi,

I don’t know if this is the right area to write this in but I will anyway.

I want to do nested Grid’s and I was going to use Yii-Booster and actually started to but then saw that this is the new and improved version thereof. So I hop over to try and notice that there are bits and pieces.

So can I

  1. use Yiistrap to do this and if so how,

  2. do I need to use Yiiwheels? But for Yiiwheels there is only a github with very little info

  3. or should I go back to Yii-booster?

Thanks,

Neil

does anybody know how i can include a css file after register() function (to override it)

because yiistrap’s css files include at the end of everything.

thanks

Hi Chris,

Thanks a lot for all the great work you’re doing!

I have a couple of questions regarding TbModal widget which is currently present in both Yiistrap and Yiiwheels:

  1. Which one I should use? What is the difference between them?

  2. How I can place another widget in the body of modal using Yiistrap or Yiiwheels? Previously I’ve used YiiBooster and it allowed to place anything in between of beginWidget and endWidget but in these new widgets I’m supposed to fill in ‘header’, ‘content’ and ‘footer’ attributes instead so it is not clear to me how I can place my custom php code (e.g. widgets, renderpartial etc.) in there?

Thank you in advance!

Hi,

When I try to use datepicker I get an error. I have in my VIEW:


    <div class="input-append">

    <?php $this->widget('yiiwheels.widgets.datepicker.WhDatePicker', array(

    'name' => 'datepickertest',

    'pluginOptions' => array(

    'format' => 'mm/dd/yyyy'

    )

    ));

    ?>

    <span class="add-on"><icon class="icon-calendar"></icon></span>

    </div>

and in the start of my ../layouts/main.php


<?php /* @var $this Controller */ ?>

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

...

..

.



The error I get is:

Fatal error: Call to a member function getApi() on a non-object in C:\wamp\www\test\protected\extensions\yiiwheels\behaviors\WhPlugin.php on line 43

Anyone has any idea what I am doing wrong?

Hi wannabe,

I think this is a YiiWheels issue, and not YiiStrap. I had the same problem and after I declared the component yiiwheels in the maon configuration file, everything worked fine.




'yiiwheels' => array( 	

  	'class' => 'yiiwheels.YiiWheels', 

),



Hope this helps

ciao

B)

Yup that did it :slight_smile:

I thought so already something in these lines. But I wasn’t quite sure what to do.

Another ‘thingy’ I have is that the input boxes are too narrow. Should I declare the CSS somewhere as well to make it right?

Oh and also


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

Throws off the CSS completely. I use instead:


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

I thought that RegisterAllScripts will register everything and therefor everything should work as it should … Perhaps the documentation can be more clear on these matters.

Yep, had exactly the same issue and created one on Github but Antonio didn’t seem to understand my explanation :rolleyes:

how to use bootswatch themes with yiistrap extension in yii

Hi Yogeshbansal,

here is what I did. I don’t think that’s good practise because it modifies the yiistrap extension folder (which is not good).

Anyway assuming yiistrap is installed in extensions/bootstrap :

[list=1][]duplicate the folder extensions/bootstrap/assets/css and rename it css.original (or backup)[]download bootstrap.css and bootstrap.min.css from bootswatch and copy them into extensions/bootstrap/assets/css[]remove all files from webapp/assets[]refresh page[/list]

hope it helps

ciao

B)

I am lost with CSS issues when using YiiStrap & Wheels, btw I had exactly the same problem with Yii-Booster.

The main problem is that the textields are too narrow and some widgets are not displayed properly. I read on stackexchange that Yii CSS is overriding Yiistrap CSS. So I removed the CSS references in layout/main.php and things got a bit better. However still the textfields are too narrow in width and height (see picture, one from Mozilla and the other from IE). If I check the same page on IE9, the textfields are soo narrow that you cannot read the text any longer.

My layout/main.php starts as follows:

<?php /* @var $this Controller */ ?>


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

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

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


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

...

...



I also tried only using ->register() and other variations, however nothing seems to resolve my issue.

How can I fix these problems? Its very annoying.

try to call only :


Yii::app()->bootstrap->register();

I’m using the latest version downloaded from http://www.getyiistrap.com and it works fine.

I tried that, but no luck.

What I basically do is a clean install of Yii, create a webapp and then install Yiistrap & Wheels.

The only two things I change is config/main.php to add Yiistrap & Wheels

And I change layout/main.php , in this document I remove all CSS references and add a Yii Navbar.

I then create a new controller and a view, and in my view I put the Yiistrap widgets.

I cleaned out the folder ‘Assets’ and reload the page. And presto the above mentioned problems are there.

Do I perhaps miss something ? Do I need to add a <div> or load CSS somewhere?

Perhaps someone can share their layout/main.php file with me? Or even better, share their controller & view with a working version of timepicker?

EDIT: After reinstalling everything it works like a charm. No idea why.

Does anyone guide me how to replace Yiibooster with YiiStrap and YiiWheels On YiiBoilerplate.

Best Regards.

Hi,

Can someone be as kind to explain to me on how to use the code below in Yiistrap format?


echo $form->label($model,'product'); 

echo $form->textField($model,'product',array(

  'style'=>'width:250px;') );

I have been fiddling with

echo TbHtml::textField(‘text’, ‘’, array(‘placeholder’ => ‘Type something…’));

thanks in advance :)

I think you can use textFieldControlGroup:


echo $form->textFieldControlGroup($model, 'product', array('class'=>'span3'));

yeah works perfectly. thanks a lot !


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

'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,));


echo $form->textFieldControlGroup($model, 'product',

array('help' => 'In addition to freeform text, any HTML5 text-based input appears like so.'));


$this->endWidget();

Extension looks good, I will try it out soon.

Is there anyone able to answer this? I still have no idea how to put widget inside new TbModal :(

Am trying to create a link button as per the following code but the link is not working. In yiibooster it used to work. Any idea how to fix it.


<?php

echo TbHtml::button('Forgot Password',

array(

'color' => TbHtml::BUTTON_COLOR_PRIMARY,

'url'   => Yii::app()->createUrl('user/forgotpassword'),

));

?>

This is how I did for my login form widget.




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

'id'=>'login-form',

'enableClientValidation' => true,

 )); ?> 

<fieldset>

<?php echo $form->textFieldControlGroup($model, 'username',  array('label' => 'Username', 'placeholder' => 'Username')); ?>

<?php echo $form->passwordFieldControlGroup($model, 'password',  array('label' => 'Password', 'placeholder' => 'Password')); ?>

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

</fieldset>

<?php echo TbHtml::formActions(array(

TbHtml::submitButton('Login', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'id' => 'loginBtn', 'class'=>'btn btn-info')),

)); ?>

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