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

Jump to content

  • (45 Pages)
  • +
  • « First
  • 31
  • 32
  • 33
  • 34
  • 35
  • 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

#641 User is offline   lalo64 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 14-August 12
  • Location:Rio Gallegos Santa Cruz Argentina

Posted 21 August 2012 - 06:10 AM

English
Hi, I am new to Yii and I want to install this extension, but I get this error, could you tell me how to fix it?

spanish
hola, soy nuevo en yii y me interesa instalar esta extension, pero me sale este error, podrian decirme como lo arreglo?

CException
Alias "ext.bootstrap.components.Bootstrap" is invalid. Make sure it points to an existing PHP file and the file is readable.

thanks
0

#642 User is offline   Gustavo Andrade 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 16-August 11
  • Location:Brazil - MG

Posted 21 August 2012 - 07:17 AM

View Postlalo64, on 21 August 2012 - 06:10 AM, said:

English
Hi, I am new to Yii and I want to install this extension, but I get this error, could you tell me how to fix it?

spanish
hola, soy nuevo en yii y me interesa instalar esta extension, pero me sale este error, podrian decirme como lo arreglo?

CException
Alias "ext.bootstrap.components.Bootstrap" is invalid. Make sure it points to an existing PHP file and the file is readable.

thanks


Hi,

Unzip the extension in the directory
\protected\extensions\bootstrap


and post your
\config\main.php
to see
0

#643 User is offline   Gustavo Andrade 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 16-August 11
  • Location:Brazil - MG

Posted 21 August 2012 - 07:25 AM

Guys, how do I make a field to feed "dropDownListRow" with data from a database table ???

I had done so

<?php
    $nivelusuario = CHtml::listData(NivelUsuario::model()->findAll(), 'id_nivel_usuario', 'desc_nivel');
    echo $form->dropDownListRow($model, 'id_nivel_usuario', array('prompt'=>'--Selecione--',$nivelusuario)); 
?> 


but appeared a zero field, as shown the img: imageshack.us/photo/my-images/109/errojo.jpg

what is the correct way?
0

#644 User is offline   Don Felipe 

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

Posted 21 August 2012 - 07:50 AM

View PostGustavo Andrade, on 21 August 2012 - 07:25 AM, said:

Guys, how do I make a field to feed "dropDownListRow" with data from a database table ???

I had done so

<?php
    $nivelusuario = CHtml::listData(NivelUsuario::model()->findAll(), 'id_nivel_usuario', 'desc_nivel');
    echo $form->dropDownListRow($model, 'id_nivel_usuario', array('prompt'=>'--Selecione--',$nivelusuario)); 
?> 


but appeared a zero field, as shown the img: imageshack.us/photo/my-images/109/errojo.jpg

what is the correct way?


Hola Gustavo,
the additional "prompt" has to go into htmlOptions - the 4th parameter:
dropDownListRow($model, 'attribute', dataArray, htmlOptionsArray).

echo $form->dropDownListRow($model, 'id_nivel_usuario', $nivelusuario, array('prompt'=>'--Selecione--'));


Saludos,
Don Felipe
1

#645 User is offline   Gustavo Andrade 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 16-August 11
  • Location:Brazil - MG

Posted 21 August 2012 - 08:11 AM

View PostDon Felipe, on 21 August 2012 - 07:50 AM, said:

Hola Gustavo,
the additional "prompt" has to go into htmlOptions - the 4th parameter:
dropDownListRow($model, 'attribute', dataArray, htmlOptionsArray).

echo $form->dropDownListRow($model, 'id_nivel_usuario', $nivelusuario, array('prompt'=>'--Selecione--'));


Saludos,
Don Felipe



Perfect!! Thanks my friend ^^
0

#646 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 21 August 2012 - 11:19 AM

About the glyphs licensing issue: https://github.com/t...rap/issues/4485

It seems like it is ok to avoid the attribution note.
Yii user #37
0

#647 User is offline   Lothor 

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

Posted 21 August 2012 - 01:25 PM

The problems with modal and resizing the browser will be adjusted in the new version?
0

#648 User is offline   Don Felipe 

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

Posted 21 August 2012 - 09:45 PM

View Postekerazha, on 21 August 2012 - 11:19 AM, said:

About the glyphs licensing issue: https://github.com/t...rap/issues/4485

It seems like it is ok to avoid the attribution note.


This link is a nice find and it's good to know that we do NOT have to add that link but are asked to if we want! Having said this, I wouldn't mind if Chris added a link in the footer of the demo page/s. We should be glad we're allowed to use the icons for free whatsoever. Afaik, "Glyphicons" is not mentioned at all on the demo page. Adding such link would provide more information about where the icons come from and maybe it's useful for someone who wants to purchase the whole set in different colors hence some extra information won't hurt anybody.

Thanks for the research, ekerazha.
0

#649 User is offline   yiistudent 

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

Posted 22 August 2012 - 04:31 AM

Hello All, how to make sub menu like wordpress nav sub menu, images on attatcment file bellow??

Attached File  Screen shot 2012-08-22 at 4.20.34 PM.png (10.8K)
Number of downloads: 14

i try to make with this code

array('label'=>'Library', 'icon'=>'book', 'url'=>'#', 'type'=>'list', 'items'=>array(
									array('label'=>'Create Content', 'url'=>array('/library/create')),
									array('label'=>'Draft Content', 'url'=>array('/library/draft')),
									array('label'=>'Pending Content', 'url'=>array('/library/pending')),
							)),


but the result show is dropdown, not sub menu
Attached File  Screen shot 2012-08-22 at 4.36.16 PM.png (10.54K)
Number of downloads: 13


how to make sub menu like wordpress nav sub menu, like my first attachmnent image?
0

#650 User is offline   Daniel Chen 

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

Posted 22 August 2012 - 10:02 AM

Hi All,

I would like to change the bootstrap.widgets.TbNavbar background color based on the Twitter 2.1.0 Wip guideline, but it doesn't work (I'm trying with navbarBackground parameter)

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
			'id'=>'tbNavbar1',
			'navbarBackground'=>'blue',
    		'type'=>'inverse', // null or 'inverse'


Thanks for help.
0

#651 User is offline   Don Felipe 

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

Posted 22 August 2012 - 12:14 PM

View PostDaniel Chen, on 22 August 2012 - 10:02 AM, said:

Hi All,

I would like to change the bootstrap.widgets.TbNavbar background color based on the Twitter 2.1.0 Wip guideline, but it doesn't work (I'm trying with navbarBackground parameter)

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
			'id'=>'tbNavbar1',
			'navbarBackground'=>'blue',
    		'type'=>'inverse', // null or 'inverse'


Thanks for help.


"navbarBackground" is a variable used with LESS to generate the bootstrap.css file. One cannot use it as attribute and option for TbNavbar or any other widget. See this link on how LESS can be used together with bootstrap extension. You may also find useful information on how the 2 work together in this topic (previous posts) as well as the topic for LESS extension here.

Now, if you don't want to spend too much time adding LESS to your webapp, you can quickly set an alternate background-color manually...

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'id'=>'tbNavbar1',
    'type'=>'inverse', // null or 'inverse'
    'htmlOptions'=>array('style'=>'background-color:blue;'),

You may also need to add 'background-image:none;' as the default class has a subtle gradient as background-image.

Hope it helps.
Felipe
0

#652 User is offline   Daniel Chen 

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

Posted 22 August 2012 - 09:37 PM

View PostDon Felipe, on 22 August 2012 - 12:14 PM, said:

"navbarBackground" is a variable used with LESS to generate the bootstrap.css file. One cannot use it as attribute and option for TbNavbar or any other widget. See this link on how LESS can be used together with bootstrap extension. You may also find useful information on how the 2 work together in this topic (previous posts) as well as the topic for LESS extension here.

Now, if you don't want to spend too much time adding LESS to your webapp, you can quickly set an alternate background-color manually...

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'id'=>'tbNavbar1',
    'type'=>'inverse', // null or 'inverse'
    'htmlOptions'=>array('style'=>'background-color:blue;'),

You may also need to add 'background-image:none;' as the default class has a subtle gradient as background-image.

Hope it helps.
Felipe


Hi Felipe,

I trying with following code, but it still doesn't work

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'id'=>'tbNavbar1',
    'type'=>'inverse', // null or 'inverse'
    'htmlOptions'=>array('style'=>'background-color:blue;'),

0

#653 User is offline   Don Felipe 

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

Posted 22 August 2012 - 11:58 PM

View PostDaniel Chen, on 22 August 2012 - 09:37 PM, said:

Hi Felipe,

I trying with following code, but it still doesn't work

<?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'id'=>'tbNavbar1',
    'type'=>'inverse', // null or 'inverse'
    'htmlOptions'=>array('style'=>'background-color:blue;'),




Oh sorry! Problem is, the widget will place another div (.navbar-inner) inside the main div (.navbar). The above htmlOptions will add style to .navbar but any bg-color and image set in .navbar-inner will appear above the ones defined in .navbar.

Workaround:
- set a class in the above htmlOptions (e.g. 'class'=>'myNavbar')
- add the class' styles as follows

.myNavbar .navbar-inner {
background-image:none;
background-color:blue;
}

- you may need to check that your extra stylesheet is loaded after bootstrap.min.css. I usually register all additional css files at the bottom of the main view (layout) files so they are added last.

Cheers,
Felipe
0

#654 User is offline   makro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 05-November 09
  • Location:Novara, IT

Posted 23 August 2012 - 02:08 AM

Hi Chris!

Amazing release as usual! ;)

There's an issue in TbAlert: with closeText=>false it gives an error

I've inserted this code at line #88 to solve
if (!isset($alert['closeText']))
    $alert['closeText'] = $this->closeText;

0

#655 User is offline   Don Felipe 

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

Posted 23 August 2012 - 02:23 AM

View Postmakro, on 23 August 2012 - 02:08 AM, said:

Hi Chris!

Amazing release as usual! ;)

There's an issue in TbAlert: with closeText=>false it gives an error

I've inserted this code at line #88 to solve
if (!isset($alert['closeText']))
    $alert['closeText'] = $this->closeText;



Setting 'closeText'=>false works just fine on my side. Besides, check lines 116-120:
if ($this->closeText !== false && !isset($alert['closeText']))
    $alert['closeText'] = $this->closeText;

if ($alert['closeText'] !== false)
    echo '<a class="close" data-dismiss="alert">'.$alert['closeText'].'</a>'

What error message do you have on your side?

@chris83:
The sample source code for TbAlert widget on the demo page is missing 1 more closing bracket at the end.
0

#656 User is offline   Daniel Chen 

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

Posted 23 August 2012 - 09:58 AM

View PostDon Felipe, on 22 August 2012 - 11:58 PM, said:

Oh sorry! Problem is, the widget will place another div (.navbar-inner) inside the main div (.navbar). The above htmlOptions will add style to .navbar but any bg-color and image set in .navbar-inner will appear above the ones defined in .navbar.

Workaround:
- set a class in the above htmlOptions (e.g. 'class'=>'myNavbar')
- add the class' styles as follows

.myNavbar .navbar-inner {
background-image:none;
background-color:blue;
}

- you may need to check that your extra stylesheet is loaded after bootstrap.min.css. I usually register all additional css files at the bottom of the main view (layout) files so they are added last.

Cheers,
Felipe


It works well.

Thanks Felipe.

Regards,
Daniel
0

#657 User is offline   makro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 05-November 09
  • Location:Novara, IT

Posted 23 August 2012 - 10:03 AM

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

Setting 'closeText'=>false works just fine on my side. Besides, check lines 116-120:
if ($this->closeText !== false && !isset($alert['closeText']))
    $alert['closeText'] = $this->closeText;

if ($alert['closeText'] !== false)
    echo '<a class="close" data-dismiss="alert">'.$alert['closeText'].'</a>'

What error message do you have on your side?

@chris83:
The sample source code for TbAlert widget on the demo page is missing 1 more closing bracket at the end.


This is the error

"PHP notice

Undefined index: closeText"

with closeText=false

if ($this->closeText !== false && !isset($alert['closeText'])) is false so $alert['closeText'] doesn't exists
0

#658 User is offline   Don Felipe 

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

Posted 23 August 2012 - 11:31 AM

View Postmakro, on 23 August 2012 - 10:03 AM, said:

This is the error

"PHP notice

Undefined index: closeText"

with closeText=false

if ($this->closeText !== false && !isset($alert['closeText'])) is false so $alert['closeText'] doesn't exists


You could have provided a little bit more information! It took me quite a while to reproduce this error/notice - reverse debugging.

It only happens -of course it shouldn't happen at all- when many flash messages are declared first but not repeatedly listed in the alerts array while 'closeText'=>false is only set for all the alerts globally.

<?php
Yii::app()->user->setFlash('success', '<strong>Well done!</strong> You successfully read this important alert message.');
Yii::app()->user->setFlash('info', '<strong>Heads up!</strong> This alert needs your attention, but it\'s not super important.');

$this->widget('bootstrap.widgets.TbAlert', array(
        'block'=>true, // display a larger alert block?
        'fade'=>true, // use transitions?
        'closeText'=>false,
        'alerts'=>array( // configurations per alert type
            'success'=>array('block'=>true, 'fade'=>true),// success, info, warning, error or danger
        ),
)); ?>


Yay!
0

#659 User is offline   makro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 05-November 09
  • Location:Novara, IT

Posted 24 August 2012 - 01:38 AM

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

You could have provided a little bit more information! It took me quite a while to reproduce this error/notice - reverse debugging.

It only happens -of course it shouldn't happen at all- when many flash messages are declared first but not repeatedly listed in the alerts array while 'closeText'=>false is only set for all the alerts globally.

<?php
Yii::app()->user->setFlash('success', '<strong>Well done!</strong> You successfully read this important alert message.');
Yii::app()->user->setFlash('info', '<strong>Heads up!</strong> This alert needs your attention, but it\'s not super important.');

$this->widget('bootstrap.widgets.TbAlert', array(
        'block'=>true, // display a larger alert block?
        'fade'=>true, // use transitions?
        'closeText'=>false,
        'alerts'=>array( // configurations per alert type
            'success'=>array('block'=>true, 'fade'=>true),// success, info, warning, error or danger
        ),
)); ?>


Yay!


I'm using only one alert!
0

#660 User is offline   Daniel 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 226
  • Joined: 26-September 09

Posted 27 August 2012 - 01:03 AM

Hi All,

how to add a login form on the dropdown of the Navbar? I would like to have similar to twitter login box. For user login (management) I used yii-user.

Thanks in advance.
0

Share this topic:


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

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