Bootstrap 2 - extension 0.98

Hi Chris,

I can’t get the extension 0.98 (new bootstrap 2) to work.

I take the example on the extension home and immediately get an exception:

Property "BootActiveForm.stacked" is not defined.

Thanks,

Yoav

Hi,

I had the same issue.

Just remove it as it seems it’s not used anymore.

I think it’s now stacked by default.

If you need horizontal use:

‘type’=>BootActiveForm::TYPE_HORIZONTAL,

Hope this helps

Best,

Ivan

Hi Ivan,

Thanks for the quick answer.

I get the error for the next line:

"Property "BootActiveForm.errorMessageType" is not defined."

My code is the simple login screen:

<?php $form=$this->beginWidget(‘ext.bootstrap.widgets.BootActiveForm’, array(

'id'=&gt;'SiteLoginForm',

// ‘stacked’=>false, // should this be a stacked form?

'errorMessageType'=&gt;'inline', // how to display errors, inline or block?


'enableAjaxValidation'=&gt;false,

)); ?>

&lt;?php echo &#036;form-&gt;textFieldRow(&#036;model,'email',array('class'=&gt;'span3')); ?&gt;


&lt;?php echo &#036;form-&gt;passwordFieldRow(&#036;model,'password',array('class'=&gt;'span3')); ?&gt;


&lt;?php echo &#036;form-&gt;checkBoxRow(&#036;model,'rememberMe'); ?&gt;





&lt;div class=&quot;actions&quot;&gt;


    &lt;?php echo CHtml::submitButton('Log in',array('class'=&gt;'btn primary large')); ?&gt;


&lt;/div&gt;

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

The main config is:

<?php

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'SocioPal',





// preloading 'log' component


'preload'=&gt;array


	(


		'log',

[color="#FF0000"] ‘bootstrap’, // preload the bootstrap component

[/color] ),

// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


	'ext.YiiMongoDbSuite.*',

[color="#FF0000"] ‘ext.bootstrap.widgets.*’,

[/color]// ‘ext.slidingmessage.*’,

),





'modules'=&gt;array(


// uncomment the following to enable the Gii tool


	/*


	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'tamar123',


	 	// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('127.0.0.1','::1'),


		'generatorPaths'=&gt;array(


        					'ext.YiiMongoDbSuite.gii',


        ),


	),


	*/


	


),





// application components


'components'=&gt;array(


	'user'=&gt;array(


		// enable cookie-based authentication


		'allowAutoLogin'=&gt;true,


	),


	// uncomment the following to enable URLs in path-format


	


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		//'showScriptName'=&gt;false,


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),

[color="#FF0000"] ‘bootstrap’ => array(

    	'class'=&gt;'ext.bootstrap.components.Bootstrap',


    	),

[/color]

	/*


	'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),


	*/


	// uncomment the following to use a MySQL database


	


	


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


        'errorAction'=&gt;'site/error',


    ),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

For the form type you can either use the constant or simply ‘horizontal’.

As for the second issue errorMessageType was replaced with a boolean inlineErrors.

To resolve the issue simply remove the errorMessageType.

Please ask if you encounter any other issues, I’ll try to reply as soon as possible.

If you want to try the new version you can check example code from the live demo:

http://www.cniska.net/yii-bootstrap/demo/

Don’t use the old example on the extension page as they are for the current release (0.9.7b).

Thanks again.

Can you upload or send a zip of the sample demo project including yii files?

I am having problems putting them all together and starting with something that is working will help a lot.

Thanks,

Yoav

You can get them from Bitbucket, just download the nativejs branch as a zip file and you’ll have a working demo app.

Thanks, helped me!

BTW. there is an issue with less 1.2.1 (you get an error “Cannot read property ‘local’ of undefined”).

I recommend to download and use less 1.2.2.

Yoav