Yii 1.1: foundation3

An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
32 followers

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

Yii Foundation 3

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

  1. Download the files and extract them to you project's desired folder
  2. Add the following code to your application configuration:

    ...
    'preload'=>array(
        .....
        'foundation', // preload the foundation component
    ),
    'components'=>array(
        .....
         // assuming you extracted foundation under extensions
        'foundation' => array("class" => "ext.foundation.components.Foundation"),
     
    ),
    ...
  3. 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

Changelog

0.1.3

-Added form prefix and postfix support

Total 10 comments

#13554 report it
StephenM at 2013/06/05 03:48pm
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.

#13536 report it
dharrison at 2013/06/04 10:58am
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

#12587 report it
seb7 at 2013/03/30 06:51am
foundation 4

@Mariaczi+PL : Not yet : github issue 4

#12586 report it
Mariaczi+PL at 2013/03/30 06:37am
Foundation 4

Are yoy planning to release Foundation4 for Yii ?

#11510 report it
leventis at 2013/01/17 03:43pm
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.

#10721 report it
natb19 at 2012/11/19 04:03am
RE: IE7

Thanks for that Chris83, have you had any problems with using this shim?

#9568 report it
petko at 2012/08/23 03:18pm
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.

#9529 report it
Asgaroth at 2012/08/21 01:15am
@crwhite0527

Normally extensions folder, but who knows, you may want to put it on the components folder, or somewhere else.

#9527 report it
cwhite at 2012/08/20 06:23pm
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?

#9232 report it
Chris83 at 2012/07/30 06:48pm
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. :)

Leave a comment

Please to leave your comment.

Create extension