[EXTENSION] Foundation


(Asgaroth Belem) #1

Forum Post discussion for the Yii Foundation extension


(Yiqing 95) #2

well done! :lol:

a good start for introducing another framework to yii ( this may become the competitor to bootstrap !)


(Heartshare) #3

great!!!! :lol:

B) especially : http://foundation.oakwebdev.com/index.php?r=site/ui


(Jacob Moen) #4

I approve of this extension! :lol:


(Phil Loaiza) #5

I had to add:

‘import’=>array(

'ext.foundation.components.*',

in order for it to work for me.


(Asgaroth Belem) #6

Are you sure you have


'preload'=>array(

    .....

    'foundation', // preload the foundation component

),

In your config?


(Charlespick) #7

Great work!

Am I right in saying this is almost drop in compatible with Chris83’s bootstrap extension?


(Asgaroth Belem) #8

Well this extension is heavily inspired by his. but foundation and bootstrap themselves have notable differences.


(Peterjkambey) #9

well then,

in new release of foundation ext, how to use NavBar and SubNav?


(Asgaroth Belem) #10

There are examples in the online docs

Here is one:


<?php

$this -> widget("foundation.widgets.FounNavBar", array('items' => array(

    array('label' => 'Nav Item 1'),

    array('label' => 'Nav Item 2', 'flyout' => array('small', '<h5>Small Example (200px)</h5>

    <p>

        This is example text. This is example text. This is example text. This is example text. This is example text. This is example text. This is example text. This is example text.

    </p>')),

    array('label' => 'Nav Item 3', 'flyout' => 'content...'),

    array('label' => 'Nav Item 4', 'flyout' => array(

        'large right',

        'content...', true

    )),

)));

?>


(Peterjkambey) #11

Yaps…my Friends… i dont realize that http://foundation.oakwebdev.com/ is the Foundation Yii-Extension Demo site. Very similiar with it’s original website. I really surprise, that it’s already there… shame on me…but thanks anyway…


(Sebako86) #12

Hey there,

I am using your extension and I am really happy with it so far! Thanks for the good job!

One question though … I havn’t seen a passwordFieldRow yet, any plans on that?

Cheers

-Seb


(Zitter) #13

It misses SubmitButton too… the project seems blocked since 1 month :(


(Asgaroth Belem) #14

eeh.,… im still a live :D, just kindda busy T_T

Ill try to get you guys an update this weekend. hail Yii!


(Zitter) #15

BTW, this is the best news :)

Is it possible to help you with your project? For example, how to create password input and submit one?


(Asgaroth Belem) #16

For sure!

the project its hosted on github, just fork it! https://github.com/Asgaroth/foundation


(Junior) #17

Hi, guys,

Asgaroth, thank you very much for the extension.

Has anybody implemented the password field yet?

:)

Thanks


(Junior) #18

Ooops, answer my own question, password field is implemented on git. :) - thanks

I would like to suggest the following to improve the extension, I’ve made these changes to fit my needs and thought it could be useful to others:

  • option to register app.css file or even a custom app.css file (see code below)

  • make registerJs() method public (why? - because sometimes I just want to force registering js files and sometimes in specific places)

  • register Js files with POS::END option

  • change the text in comments Registers the Foundation CSS instead of Registers the Bootstrap CSS

Foundation.php




	/**

	 * @var boolean whether to register the Foundation app CSS (app.css) or another file

	 * Defaults to true, but only registers if coreCss is also true

	 */	

	public $appCss = true;




And the code




	/**

	 * Registers the Foundation CSS.

	 */

	public function registerCss() {

		Yii::app() -> clientScript -> registerCssFile($this -> getAssetsUrl() . '/stylesheets/foundation.css');

		if($this->appCss):

			if(is_bool($this->appCss))

				Yii::app() -> clientScript -> registerCssFile($this -> getAssetsUrl() . '/stylesheets/app.css');

			else

				Yii::app() -> clientScript -> registerCssFile($this->appCss);

		endif;

	}




	/**

	 * Registers the core JavaScript plugins.

	 * @since 0.9.8

	 */

	public function registerJs() {

		Yii::app() -> clientScript -> registerCoreScript('jquery');

		Yii::app() -> clientScript -> registerScriptFile($this -> getAssetsUrl() . '/javascripts/modernizr.foundation.js',  CClientScript::POS_END);

		Yii::app() -> clientScript -> registerScriptFile($this -> getAssetsUrl() . '/javascripts/foundation.js',  CClientScript::POS_END);

		Yii::app() -> clientScript -> registerScriptFile($this -> getAssetsUrl() . '/javascripts/app.js',  CClientScript::POS_END);

	}




I’m pretty sure somebody has a good approach to do this or even better idea. This is only my two cents trying o improve this excellent extension!

:)

Best regards!


(Asgaroth Belem) #19

@Junior - df9

I just uploaded a new version added most of the recommendations except for the app.css which is not something that belongs to the application and not the extension, it is there only because it belongs to foundation it self, I might remove it latter (I should have now but I forgot to xD).

You are not supposed to edit any extension files, instead create an app.css in your CSS folder and include it manually.

Thanks for your feedback!


(Junior) #20

@Asgroth

You’re right about app.css.

Thank you very much for applying the changes, I’ve already downloaded the new version. :)

Best regards!