Configure button in Bootstrap

Asked

Viewed 361 times

0

I’m new to Yii and I’m wearing Bootstrap. I set it right but it is strange in the execution of the page, for example I inserted a button, it is inserted normally only in the form of simple link. Why?

<?php /* @var $this SiteController */ $this->pageTitle=Yii::app()->name; ?> 
<?php $this->beginWidget('bootstrap.widgets.TbHeroUnit', array( 'heading'=>'Hello, world!', )); ?> 
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>  
<p>
   <?php $this->widget('bootstrap.widgets.TbButton', array( 'type'=>'primary', 'size'=>'large', 'label'=>'Learn more', )); ?>
</p> 
<?php $this->endWidget(); ?>

  • 1

    If you can post an example of the error will make it easy enough to help you

  • Really and question is not very well formatted, but I think it is too early to think about closing it, let’s wait a while and the answer of the author of the question.

  • Author of the question, take a look at this How to ask

  • I put an image to make it clear

  • Now put your HTML too. without seeing how you’re putting the button, there’s no help

  • <?php /* @var $this Sitecontroller */ $this->pageTitle=Yii::app()->name; ? > <? php $this->beginWidget('bootstrap.widgets.Tbherounit', array( 'Heading'=>'Hello, world!', )); ? > <p>This is a simple Hero Unit, a simple Jumbotron-style Component for Calling extra Attention to featured content or information. </p> <p>? php $this->widget('bootstrap.widgets.Tbbutton', array( 'type'=>'Primary', 'size'=>'large', 'label'=>'Learn more', );? ></p> <? php $this->endWidget(); ?>

  • that’s what the site provided me

  • @user3677610 please edit your question and put this one code

  • You got it right here 'label'=>'Learn more', one more comma, the one from the end. Experiment without it.

Show 4 more comments

1 answer

2


See on documentation that by default it is created as link

Your line should stay like this:

PHP

<?php $this->widget('bootstrap.widgets.TbButton', array(
   'buttonType' => 'button',
   'type' => 'primary',
   'size' => 'large',
   'label' => 'Learn more'
)); ?>

Also when using an array, in the last element do not add the comma.

  • thank diego vieira gave it right here :D

  • Have @user3677610, as you are learning the framework is always interesting to keep the documentation open on the side, it is the easiest way to master it!! a big hug and good luck with the project.

  • thank you very much for the advice diego ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.