yiifoundation Extension Library for ZURB Foundation 4

  1. Installation
  2. Requirements
  3. Resources

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.

[![YiiFoundation](http://yiifoundation.2amigos.us/images/snapshot-yiifoundation.png "YiiFoundation")](http://yiifoundation.2amigos.us)

Installation

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:

Examples

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(
    array(
        'title'      => '<h1><a href="#">Macho Macho man</a></h1>',
        'rightItems' => array(
            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(
        array(
            'content' => '<img src="holder.js/1200x250/text:Slide_1" alt="slide image">',
            'caption' => 'Mi caption 1'),
        array(
            'content' => '<img src="holder.js/1200x250/text:Slide_2" alt="slide image">',
            'caption' => 'Mi caption 2'),
        array(
            '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.

Requirements

  • 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.

Resources

2amigOS!
web development has never been so fun
www.2amigos.us

6 0
22 followers
0 downloads
Yii Version: Unknown
License: BSD-2-Clause
Category: Others
Developed by: Antonio Ramirez
Created on: Aug 4, 2013
Last updated: 4 years ago

Related Extensions