Yii Playground: collaborative demo app.

i found this cool RightMenu… i wrapped the code into a generic sidebar slider extension for yii.

can i post this extension on the yii extensions site? i would refer to the yii playground team, because i used this code. i did not found any licence… so i don’t know if this is ok or not

surly you can post any extension which may be useful to others ! if your extension is just suitable to yiiplayground you can refer here how to contribute or if it 's generic just post it as a yii extension to the official repository ! :D

ok… i added it here: http://www.yiiframework.com/extension/rightsidebar/

i hope everything is ok with it

Hello,

yes don’t worry about that. I wrote it as part of the Yii Playground project and it has the same license of the project. (New BSD License)

bye,

Giovanni.

Hello,

everybody can contribute to it ;)

Anyway, the answer is yes. I’ve just fixed a few bugs and started a new branch for Yii Playground based on Yii 2.

The Yii 2 version is still on early stage (there is only the basic app for now, no demos nor Yii Playground specific components) since I just started it. But any feedback is welcome since I’m new to both Yii 2 and composer.

Please see:

http://yiiplayground.com/yii2/

Also, for version 2 I’m thinking of organising the content following the structure of the official guide.

bye,

Giovanni.

Hello,

a quick update: I finally managed to port the base components and extensions to Yii 2 / composer (see here). So now the playground is ready to be used :)

http://yiiplayground.com/yii2/

There are no examples yet but they’ll hopefully arrive soon!

bye,

Giovanni.

Hi Giovanni

Found your CTreeView code on YiiPlayground. Could you help how to fetch data from 2 models into this tree? In your example you use static data:


public function actionTreeView() {

	$dataTree=array(

		array(

			'text'=>'Grampa', //must using 'text' key to show the text

			'children'=>array(//using 'children' key to indicate there are children

				array(

					'text'=>'Father',

					'children'=>array(

						array('text'=>'me'),

...

...

...

...

I would need to fetch to this tree data from model1 and model2 where model2.parent_id=model.id - model 1 is expandable node, model 2 represents leafs. Model 1 can have 1 or more leafs. No more nesting.


public function actionTreeView() {

	$dataTree=array(

		array(

			'text'=>'Grampa', 

			'children'=>array(//using 'children' key to indicate there are children

				array(

					'text'=>'Father',

					'text'=>'Father''s brother',

			'text'=>'Gramna', 

			'children'=>array(//using 'children' key to indicate there are children

				array(

					'text'=>'Mother',

					'text'=>'Mother''s sister',					

...

...

...

...

Grandma and Grandpa from model1. Father and his Brother from model 2. Father.parent_id=Grandpa.id and Father’s_brother.parent_id=Grandpa.id…

Could you help

Hello,

if you haven’t solved this yet, please discuss about it by opening a new topic.

bye,

Giovanni.

Solved

http://www.yiiframework.com/forum/index.php/topic/51909-ctreeview-nodes-from-model1-leafs-from-model2-solved/

Thank You

Hello,

some updates on Yii Playground for Yii 2.x:

I’ve updated the app with an ajax request example and some other basic examples.

Please review the ajax request one and let me know what do you think (and feel free to submit a pull request if you want to improve it):

http://yiiplayground.com/yii2/web/index.php?r=ajax/index

Also please note that the left menu and the app structure are temporary. I’d like to use bootstrap list-group for the menu (as in the guide) but don’t want to install an extension for that so I’m waiting to see if an official widget will be available.

The app structure will maybe reorganised in modules (as in the playground for Yii 1.x)

bye,

Giovanni.