Yii extension for Foundation
Foundation is an easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
Dive into responsive prototyping with Foundation
Demo ¶
Foundation 3 ¶
Foundation 3 was rebuilt from the ground up to syntactically similar, but not identical, to Foundation 2. Much of what you already know about Foundation applies, including how to use the Grid, many of the common elements, and how the responsive aspects work.
With that being said there are significant differences to be aware of. In some cases, markup had to be modified to support a new case or to be more customizable or extensible. In other cases we've streamlined the framework so that there's less extra styling, so some extraneous classes will no longer take effect.
You may also read the official Zurb migration guide
Setup instructions ¶
- Download the files and extract them to you project's desired folder
Add the following code to your application configuration: ~~~ [php] ... 'preload'=>array(
..... 'foundation', // preload the foundation component
), 'components'=>array(
..... // assuming you extracted foundation under extensions 'foundation' => array("class" => "ext.foundation.components.Foundation"),
), ... ~~~
Start using it, check the documentation on using forms, and UI Components
Info: This is a work in progress, not all components of foundation are to be found in the Yii extension yet. but you can still use them as you normally would use Foundation.
Resources ¶
- Forum Discussion : for any questions or community support
- Project page : to fork and contribute
- Demo
- Foundation
Changelog ¶
0.1.3 ¶
-Added form prefix and postfix support
IE7
You can get Foundation3 to work on IE7 using a specific .htc file.
Check out this link https://github.com/Schepp/box-sizing-polyfill/blob/master/boxsizing.htc
It's nice that you started this project Asgaroth so that I don't have to. :)
What folder to install?
'Download the files and extract them to you project's desired folder'
Can you be more specific? I'm new to YII (but not to php). Do these go in the themes folder or in the protected folder?
@crwhite0527
Normally extensions folder, but who knows, you may want to put it on the components folder, or somewhere else.
Small error
FounActiveForm.php, line 313 is
$html = CHtml::tag( 'mall', $htmlOptions, '' );
should be:
$html = CHtml::tag( 'small', $htmlOptions, '' );
However, even with this fix I see no error formatted like in the Foundation examples (it does not add 'error' class to the input element). To fix this add the following in the beginning of the "error" function in FounActiveForm.php:
if( empty($htmlOptions) ) $htmlOptions['class'] = 'error';
Even then forms with client validation don't show proper error style for the input elements and labels, but at least they show the error text.
RE: IE7
Thanks for that Chris83, have you had any problems with using this shim?
Set Up
I just saw that cwhite had a problem and it took me 2 minutes to set it up so I thought I would share this.
I copied the whole foundation folder into:
/projectName/protected/components/
Then opened this file:
/projectName/protected/config/main.php
Added this:
'components'=>array( /*...*/ 'foundation'=>array( "class" => "application.components.foundation.components.Foundation" ), //use , if there are more components /*...*/ ),
I hope this helps someone.
Foundation 4
Are yoy planning to release Foundation4 for Yii ?
foundation 4
@Mariaczi+PL : Not yet : github issue 4
How do I know if it's working?
I'm sorry if this is a dumb question, but all that happened after I took the steps above was that the default widgets in the default right-hand column shot off to the bottom of the page.
Is this correct behavior and now I have to go build a theme based on Foundation, or is this a partial success ... or something else, I guess? Any help much appreciated.
thanks
Foundation 4
Hi @Mariaczi+PL and other Foundation fans.
I took a slightly different approach to bundling Foundation 4 with Yii and Giix, just a couple of folders of templates to integrate it.
Posted here if you're interested.
And thanks to @Asgaroth for introducing me to Foundation & Yii.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.