How can I apply ZURB style to Yii

I know how to set the id but not class attribute for CHtml::beginForm()

I am using ZURB foundation and I want to create ‘nice’ forms

Please help

CHtml::beginForm($action, 'post', array('class'=>'my-class'));

Class reference:


I tried this and it did not work.

I will try again.


How can I apply Zurb foundation CSS to

CHtml::dropDownList(‘Gametype’,$select, $list,array(‘empty’ => ‘(Select a game)’));



please read this link



Its not working

This is what i trying to do…Apply below CSS to CHtml::dropDownList

[b]From Zurb’s example

(at bottom of the page)

<label>Dropdown Label</label>

<select style="display:none;">

<option SELECTED>This is a dropdown</option>

<option>This is another option</option>

<option>Look, a third option</option>


<div class="custom dropdown">

<a href="#" class="current">This is a dropdown</a>

<a href="#" class="selector"></a>


&lt;li&gt;This is a dropdown&lt;/li&gt;

&lt;li&gt;This is another option&lt;/li&gt;

&lt;li&gt;Look, a third option&lt;/li&gt;




Please help me replacing blueprint with ZURB for CMenu widget.


NOTE: I moved/merged your topics about ZURB because the way you started you would create a new topic for every Yii component

It seems that the magic behind the Zurb Foundation and Yii is generally quite compatible except when it comes to forms. The dropdownlist is the most obvious example.

I’m pretty sure that when Zurb Foundation hooks into form fields, which happens when you put the class “custom” on the form ( you can do this easily using htmlOptions ):


$form=$this->beginWidget('CActiveForm', array(





	'htmlOptions'=>array("class"=>"custom"),  // Foundation3 custom forms conflict with Yii forms



I noticed that as soon as I did this, while I got “custom dropdown” look and feel from the Zurb Foundation, my ajax on my dropdown stopped firing. Also that the Zurb Custom dropdown looked nasty, the field wasn’t displayed full width (kinda crumpled) until the user selected one of the options - not usable.

I don’t know enough about how either of these work, but it would be awesome if they could work together. Most other Zurb Foundation magic such as grids, buttons, elements etc. can be easily integrated into a Yii app and it works great. I did this by creating a new theme called “foundation3” and then changing the main layout to include the css and js from Zurb Foundation from the theme. In most cases you can add “class” or “htmlOptions” coding to Yii widgets and method calls to get Foundation functionality - but not for forms.

I’m thinking though that changes to the Yii framework might be required to make forms play nice with the Zurb Foundation.