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 !
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.
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…
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)