Extension Library for ZURB Foundation 4

YiiFoundation is the extension library for ZURB Foundation 4.

We have taken the best of both architectures (helpers | widgets) and build a new library to help boost your web applications, this time we have chosen ZURB Foundation 4. It is making use of 'namespaces', as we have the new Yii2 comer into account.



Download the package and unzip its contents in your extensions folder. We highly recommend the use of Composer to manage your dependencies. If you use Composer, please make sure you do not make use of dev-master but versions from 1.0.1 and up.

Once on your extensions folder (please, modify the path if you are using composer), you just need to configure the library on your main.php configuration file:

// path aliases
  'aliases' => array(
      'foundation' => 'application.extensions.foundation',

Done... now we can make use of the helpers or widgets by importing them with 'use' keyboard or typing the namespace path to the object:


Here is a list of some examples. Hope is enough to keep you going, the demo site will be ready soon.

// button helper
use foundation\helpers\Button;
use foundation\helpers\Icon;
use foundation\enum\Enum;
// ...
echo Button::link('Small Button', array('class' => Enum::SIZE_SMALL));
echo Button::button(
   Icon::icon(Enum::ICON_ADDRESS_BOOK) . ' Small with Icon',
   array('class' => Enum::SIZE_SMALL));
// Alerts
use foundation\helpers\Alert;
echo Alert::alert("\nThis is an alert message");
echo Alert::success("\nThis is an alert message", array('class' => Enum::RADIUS_RADIUS));
// Progress 
use foundation\helpers\Progress;
echo Progress::bar('40%');
echo Progress::success(50, array('class' => Enum::RADIUS_ROUND));
// topbar (navigation bar) - check the method 'display' no need to 
// to create the widget
echo \foundation\widgets\TopBar::display(
        'title'      => '<h1><a href="#">Macho Macho man</a></h1>',
        'rightItems' => array(
                'label' => 'top item',
                'url'   => '#',
                'items' => array(
                    array('label' => 'dropdown 1', 'url' => '#')
// orbit - you need holderjs library to display the images
echo \foundation\widgets\Orbit::display(array(
    'items' => array(
            'content' => '<img src="holder.js/1200x250/text:Slide_1" alt="slide image">',
            'caption' => 'Mi caption 1'),
            'content' => '<img src="holder.js/1200x250/text:Slide_2" alt="slide image">',
            'caption' => 'Mi caption 2'),
            'content' => '<img src="holder.js/1200x250/text:Slide_3" alt="slide image">',
            'caption' => 'Mi caption 3')

There are too many helpers and widgets to have them as an example here... The site will be a better place for that.


  • Yii 1.13
  • PHP 5.3+

We have announced this library in order to get some feedback from you guys. So, feel free to post your questions, issues, enhancement requests to its github repository.


web development has never been so fun

Total 9 comments

#17790 report it
yiqing95 at 2014/07/22 10:31pm
any plan for yii2

hi tony : thank for sharing us this great ext ! do you have any plan for porting it to yii2 ?

#15627 report it
Eduardo Leiva at 2013/12/01 12:44pm
Aliases dont work

To make it work i have to:

  1. Download foundation files
  2. Config them in my classic theme.

  3. Set alias this way Yii::setPathOfAlias('foundation', dirname(FILE) . 'protected/extensions/foundation');

Anyone solve this in another way?

#15320 report it
Marcus Matos at 2013/10/28 02:45pm
How does this with a SCSS / Precompilers?

As a back-end developer, I'm unfamiliar with some of the newer frameworks and tools used in front-end development. It has been somewhat frustrating to get started with some of these new CSS frameworks that now require you to install a bunch of dependencies.

I thought this extension would help me quickly get started with Foundations 4 and while if definitely helped, I immediately ran into an issue when I tried to simply change the background color of the toolbar. It appears that the best way is to make use of the variables discussed on this page, which of course now requires the installation of Ruby, Compass and who knows what else.

So my question is - is the version of Foundation 4 included with this extension capable of working with an SCSS precompiler? If so, can anyone provide some tips on actually doing this? My primary dev environment is Windows 7 x64 with NetBeans 7.4.


#15049 report it
Kartik V at 2013/10/01 02:11pm
Other important widgets... Forms/Grid Views

Great work Antonio, very nice to use as always like the rest of your extensions. Any idea if other important yii widgets like ActiveForms, Form Inputs, grid/detail views will have easy helper classes?

#14428 report it
Nur Rochim at 2013/08/11 09:46am
Great and Cool Extension

Thank you amigos... you're good !

#14357 report it
Antonio Ramirez at 2013/08/06 02:59am
@martord - @sintret

Some guys have developed a gii - giix extension for Foundation 4. Hope they do not mind and allow us to include them on ours.

#14343 report it
martord at 2013/08/05 10:36am
Great extension

Thanks for the (again) amazing work from Antonio. I hope the Gii-CRUD is 'soon to be released'. Great work, as usually.

#14335 report it
Raoul at 2013/08/05 06:07am
Great !

Thanks to those 2 amigos for this new extension !

#14329 report it
sintret at 2013/08/05 01:16am
Generate with GII

I hope someday this extension with Gii-CRUD Generator too, thanks

Leave a comment

Please to leave your comment.

Create extension
No downloadable files yet