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 ¶
web development has never been so fun
www.2amigos.us
Generate with GII
I hope someday this extension with Gii-CRUD Generator too, thanks
Great !
Thanks to those 2 amigos for this new extension !
Great extension
Thanks for the (again) amazing work from Antonio.
I hope the Gii-CRUD is 'soon to be released'.
Great work, as usually.
@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.
Great and Cool Extension
Thank you amigos... you're good !
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?
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.
Thanks.
Aliases dont work
To make it work i have to:
Config them in my classic theme.
Set alias this way Yii::setPathOfAlias('foundation', dirname(FILE) . 'protected/extensions/foundation');
Anyone solve this in another way?
any plan for yii2
hi tony :
thank for sharing us this great ext ! do you have any plan for porting it to yii2 ?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.