Yii Framework Forum: [Extension] Yiistrap - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Yiistrap The brand new version of the Yii-Bootstrap extension Rate Topic: -----

#81 User is offline   prPixabit 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 22-July 13

Posted 18 January 2014 - 03:12 PM

First of all: thank you for bringing bootstrap to yii! Your work is very appreciated;

Secondly, I would like to bring up a question: how do I define the submit-URL for the TbHtml::submitButton? I tried 'url' => and 'submitUrl', both inside the options-array as well as directly in the button - without getting it to work. Can someone throw a hint? Cudos in advance!

*Edit*: I would also be interestes in using bootstrap.less; I guess I would have to register the bootstrap.less-file from assets/less instead of bootstrap.css in the TbApi?
0

#82 User is offline   dswift33 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 30-December 13

Posted 29 January 2014 - 11:34 AM

Hi,

Does anybody know how to properly add a TbHtml::navbarForm to a navbar? Specifically an AR form.

I'd like to add a login form to my navbar...

Thanks...
0

#83 User is offline   NetDaddi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-September 13
  • Location:New York, NY

Posted 06 February 2014 - 10:26 AM

View Postdswift33, on 29 January 2014 - 11:34 AM, said:

Hi,

Does anybody know how to properly add a TbHtml::navbarForm to a navbar? Specifically an AR form.

I'd like to add a login form to my navbar...

Thanks...



I hope this helps you, I came across it today. :D Happy coding…..
0

#84 User is offline   NetDaddi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-September 13
  • Location:New York, NY

Posted 06 February 2014 - 11:15 AM

Hello All,

I am having a problem with TbNavbar, Tbnav, and dropdownmenus. The dropdown functions fine as long as it is viewed full screen. As soonas the menu goes responsive, the dropdown becomes disabled. I can see the itemsfine, I just can’t click them. If I turn 'collapse'=>false, they are now functional,but the menu is not responsive anymore. This is a sample of my menu that Itried in a fresh install with no luck.

		<?php $this->widget('bootstrap.widgets.TbNavbar',array(
			'color' => TbHtml::NAVBAR_COLOR_INVERSE,
			'brandLabel'=>CHtml::encode(Yii::app()->name),
                        'display' => null,
			'collapse'=>true, // requires bootstrap-responsive.css

			'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'=>'Test Dropdown', 'items' => array(
                                                array('label'=>'Test One', 'url'=>array('/site/index')),
                                                array('label'=>'Another One', 'url'=>array('/site/page')),
                                                array('label'=>'Three is the Charm', 'url'=>array('/site/contact')),
                                                )),

                                                    array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("Login"), 'visible'=>Yii::app()->user->isGuest),
                                                    array('url'=>Yii::app()->getModule('user')->registrationUrl, 'label'=>Yii::app()->getModule('user')->t("Register"), 'visible'=>Yii::app()->user->isGuest),
                                                    array('url'=>Yii::app()->getModule('user')->profileUrl, 'label'=>Yii::app()->getModule('user')->t("Profile"), 'visible'=>!Yii::app()->user->isGuest),
                                                    array('url'=>Yii::app()->getModule('user')->logoutUrl, 'label'=>Yii::app()->getModule('user')->t("Logout").' ('.Yii::app()->user->name.')', 'visible'=>!Yii::app()->user->isGuest),
                                        ),                        
                                    ),
                                ),
       			)); ?>


0

#85 User is offline   Daniel 

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

Posted 15 February 2014 - 06:37 PM

Hello,

I have an error

include(TbArray.php): failed to open stream: No such file or directory 


I have already followed the guide from http://www.getyiistrap.com to setup the yiistrap. below is my main.php config

<?php

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'protected',
    'runtimePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'runtime',
    'name' => 'MyInventory App',
    'aliases' => array(
        // yiistrap configuration
        'bootstrap' => realpath(__DIR__ . '/../extensions/yiistrap'), // change if necessary
        // yiiwheels configuration
        'yiiwheels' => realpath(__DIR__ . '/../extensions/yiiwheels'), // change if necessary
    ),
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'bootstrap.helpers.TbHtml',
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'gii',
            'gii' => array(
                'generatorPaths' => array('bootstrap.gii'),
            ),
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
    ),
    // application components
    'components' => array(
        // yiistrap configuration
        'bootstrap' => array(
            'class' => 'bootstrap.components.TbApi',
        ),
        // yiiwheels configuration
        'yiiwheels' => array(
            'class' => 'yiiwheels.YiiWheels',
        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => false,
        ),
        '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>',
            ),
        ),
        ...
);



My directory structure is like this
myinv-app
|- protected
|- runtime
|- www

basically just moved runtime outside the protected and put index.php, index-test.php, assets folder to www.

I think the problem is with setting the bootstrap alias since I have no error when I use folder generated by yii.

Please help and thank you in advance.

Daniel
0

#86 User is offline   NetDaddi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-September 13
  • Location:New York, NY

Posted 17 February 2014 - 11:19 AM

View PostDaniel, on 15 February 2014 - 06:37 PM, said:

Hello,

I have an error

include(TbArray.php): failed to open stream: No such file or directory 



I am getting an error close to that as well:

include(TbArray.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory



My problem starts with hitting an image,

<?php echo TbHtml::image($src=Yii::app()->baseUrl.'/landimages/corner_left.png', $alt='testt'); ?>



My system runs fine with an old version 1.1.1 from Yii's site, but when I use the version that is on getyiistrap.com 1.2.0, I receive the error. Any help welcomed, thank you in advance.

Michael
0

#87 User is offline   Daniel 

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

Posted 18 February 2014 - 06:09 AM

View PostNetDaddi, on 17 February 2014 - 11:19 AM, said:

[/size]

I am getting an error close to that as well:

include(TbArray.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory



My problem starts with hitting an image,

<?php echo TbHtml::image($src=Yii::app()->baseUrl.'/landimages/corner_left.png', $alt='testt'); ?>



My system runs fine with an old version 1.1.1 from Yii's site, but when I use the version that is on getyiistrap.com 1.2.0, I receive the error. Any help welcomed, thank you in advance.

Michael


I am kind of getting the solution with adding them to import, but not sure, is this correct solution?

'import' => array(
        'application.models.*',
        'application.components.*',
        'bootstrap.helpers.TbHtml',
        'bootstrap.helpers.TbArray',
        'bootstrap.behaviors.TbWidget',
    ),


I tested on very basic things and it worked.
0

#88 User is offline   Jinsa86 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-December 13

Posted 22 March 2014 - 05:00 AM

Hi guys,

I'm just wonder concerning Widget 'bootstrap.widgets.TbActiveForm', there is always Labels next to FieldControlGroup items but how to insert fields with controls (showing errors in red if any) and not showing labels?

Ex:

Mail Address * {input field}
{error message shown here}

becomes:

{input field}
{error message shown here}

Nice work guys btw :)
0

#89 User is offline   JbalTero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 18-January 14

Posted 26 April 2014 - 06:43 AM

Hello guys, how do I install this?

https://github.com/C...iistrap-widgets
0

#90 User is offline   Azraf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 14-April 12

Posted 05 May 2014 - 12:51 AM

Hope this will help:

in main config, set path as follow:

'import'=>array(
		........
                'bootstrap.components.*',
                'bootstrap.behaviors.*',
                'bootstrap.helpers.*',
		.........
	),

It works for me.
0

#91 User is offline   CodenObrian 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 26-May 14

Posted 28 May 2014 - 11:42 AM

Can i get some help with the imageCircle function? Im trying to maker the image smaller but I am having trouble.

<?php echo TbHtml::imageCircle(image url,'', array('holder.js/140x140') ); ?>

Couldnt post the actual img url because im a new poster.

Thanks.
0

#92 User is offline   MistaMoh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 23-August 13

Posted 18 June 2014 - 04:26 PM

Hi there,

I recently upgraded to Yiistrap 1.2.0 for the sake of integrating bootstrap inputs into yii's Form Builder via the new TbForm class.

The issue here is that I can't get the extended input elements to work :

The following returns an ugly "include(dropDownList.php): failed to open stream: No such file or directory" at rendering time
class XRuleForm extends TbForm
{
        ...	
	public function __construct($option,$model,$parent)
	{		
		$this->_xRuleClass = $xRuleClass = get_class($model);
		$xClass = $xRuleClass::$labelField;
		
		$config = array(
			'title'=>t($option['Game_Option']),
			'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
			
			'elements'=>array(
				"{$xRuleClass::$idField}"=>array(
					'type'=>TbHtml::INPUT_TYPE_DROPDOWNLIST,
					'items'=>$xClass::lookup(),
					'visible'=>0, // defined during creation or save, doesn't need to be changed nor seen
				),
				'Rule_ID'=>array(
					'type'=>TbHtml::INPUT_TYPE_DROPDOWNLIST,
					'label'=>t($option['Game_Option_Desc']),
					'items'=>GamesOptionsRules::model()->lookupRules($option),
				),
			),
		);
		
		parent::__construct($config,$model,$parent);




while the following old school form definition works :

<?php $form=$this->beginWidget('TbActiveForm', array(
	'id'=>'clans-form',
	'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
	'enableAjaxValidation'=>false,
)); ?>

<?php echo $form->textFieldControlGroup($model,'Full_name',array('size'=>60,'maxlength'=>256)); ?>

<?php echo $form->textFieldControlGroup($model,'Short_name',array('size'=>60,'maxlength'=>256)); ?>

...


Please note that in the first example, when i change types to 'dropdownlist' it works.
I read the extension source code and it seems that it uses the standard cForm logic, except when a non core type is found.
In such case, it calls a controller->widget with our specific input type and that is when it crashes.

Hope someone can save me more time diving into the source code.
0

#93 User is offline   Masoud Sawari 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 103
  • Joined: 24-January 14
  • Location:Iran, Khuzestan, Ahwaz

Posted 12 July 2014 - 02:22 AM

Thank you Chris for developing the amazing Yii's Bootstrap, Yiistrap. I'm new in bootstrap and need an example to create layout with Yiistrap. can somebody help me how to do it?
sorry for my bad English!
0

#94 User is offline   masdib.banget 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 02-July 13

Posted 13 July 2014 - 09:37 PM

Hi, Chris.
Need help for use datepicker with yiistrap 1.3.0 and yiiwheels 1.0.4.
This my code :
<?php $tanggal = $this->widget('yiiwheels.widgets.formhelpers.WhDatePickerHelper', array(
                    'model' => $model,
                    'attribute' => 'CUR_DATE',
                    'inputOptions' => array('class' => 'input-medium'),
                    'name' => 'datepicker',
                    //'value' => '2000-01-01'
               ), true); 
            ?>
            <?php echo TbHtml::customControlGroup($tanggal, $model, 'CUR_DATE', array('span'=>6)); ?> 


And show this massage :
 Illegal string offset 'input' 

Why?
0

#95 User is offline   MistaMoh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 23-August 13

Posted 19 July 2014 - 08:18 AM

Hey there,

can anyone provide an example of a TbAffix implementation ?
0

#96 User is offline   rashmani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 26-August 11

Posted 19 July 2014 - 09:28 AM

@MistaMoh: this is what I have in my sidebar div:
<?php
	$panels=array();
	// General menu items
    $panels[] = array('label'=>Yii::t('app', 'Home'), 'url'=>'#', 'active' => true);
    $panels[] = array('label'=>Yii::t('app', 'Products'), 'url'=>'#');
    $panels[] = array('label'=>Yii::t('app', 'Listings'), 'url'=>'#');
?>
...
<?php $this->widget('bootstrap.widgets.TbAffix', array(
		    'offset' => TbHtml::AFFIX_POSITION_TOP,
		    ));/**/ ?>
			<?php $this->widget('bootstrap.widgets.TbNav', array(
				'type' => TbHtml::NAV_TYPE_LIST,
				'items'=>$panels,
				'htmlOptions'=>array('class' => 'your-custom-sidebar-classes', 'data-spy' => 'affix'),
				));
			?>

I strongly suggest starting from Yiistrap docs, I've managed making my layout work as expecteed by actually copying and customizing the layout used in those pages.
Hope this helps.

rash*
0

#97 User is offline   MistaMoh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 23-August 13

Posted 19 July 2014 - 03:49 PM

Thanks ! I'll try asap and let you know
0

#98 User is offline   jkofsky 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 536
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 21 September 2014 - 02:24 AM

I just downloaded this extension, installed it, and IT SUCKS!!!!!!!

I followed the posted installation instruction, and WOW got a can't find TbArray class. Modified 'import' in config to import helpers.*. Then it couldn't find something else, like TbWidget missing. So if you are think of using this look somewhere else.

I'm sorry to be so blunt but hours to get something to work is just not exceptable. With Yii2 using Twitter Bootstrap I thought that I would start learning it, to be prepared for the switch, but I guess I'll have to look elsewhere :(
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#99 User is offline   superman16885 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-June 13

Posted 22 September 2014 - 08:02 PM

View Postjkofsky, on 21 September 2014 - 02:24 AM, said:

I just downloaded this extension, installed it, and IT SUCKS!!!!!!!

I followed the posted installation instruction, and WOW got a can't find TbArray class. Modified 'import' in config to import helpers.*. Then it couldn't find something else, like TbWidget missing. So if you are think of using this look somewhere else.

I'm sorry to be so blunt but hours to get something to work is just not exceptable. With Yii2 using Twitter Bootstrap I thought that I would start learning it, to be prepared for the switch, but I guess I'll have to look elsewhere :(


I am new to yii/bootstrap as well and am trying to learn through yiistrap. I faced the same issues and finally realized that loading everything from bootstrap folder gets everything to work. Maybe you can optimize this later, but gets your through initially.

Modify \protected\config\main.php:

// autoloading model and component classes
'import'=>array(
   ...
   'bootstrap.components.*',
   'bootstrap.behaviors.*',
   'bootstrap.helpers.*',
   'bootstrap.widgets.*'
   ...
),

0

#100 User is offline   superman16885 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-June 13

Posted 13 October 2014 - 08:55 PM

View PostReza Bagheri, on 03 August 2013 - 12:18 AM, said:

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!


Hi, I ran into the exact same problem and moving my css after title fixed it, but I am wondering what the reason is for this? Did anyone figure it out?

Thanks for your post though! I am a newbie, would have spent hours trying to figure this out :)
0

Share this topic:


  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 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