Hey Guys, thanks to Giovanni (aka Virtual Darkness) for informing me of this discussion. I have been playing with Yii since November and intend to use it for at least two projects at my place of employment and possibly for a personal side-project. Ultimately, I really like what I’m getting from Yii and I want to invest in its future by making it easier for others to get going with the framework. However we want to do it, I would be happy to contribute what I can to a more comprehensive set of examples.
It doesn’t appear there’s an exact consensus as to how this should be done. I like the plug-able “playground” demo idea. Or, perhaps simply a Zii cookbook separate from the rest of Yii. One thing that occurs to me as I use things like the Jquery UI components, is that you have this ambiguous declaration in the Yii API that CJuiDialog can have an array called “options”. It’s like, gee, thanks, that explains everything. And, to an extent, it does. We just have to go back to the real jquery ui documentation and look up the options there. This seems rather crazy to me, though. Especially for this “options” parameter. It’s the most important piece of the component. Why doesn’t the Yii api, when you click on the “options” property, show you the full range of options specified in the Jquery UI docs? Furthermore, since the options shown on the Jquery UI site are for javascript and the instantiation of CJuiDialog is in php, there may need to be little clarifications made. For example, I have not yet figured out the proper way to tell my CJuiDialog what its position should be within the PHP “options” array. I, instead, have to set it with javascript before I launch.
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'addcustdialog',
'options'=>array(
'title'=>'Add New Customer',
'autoOpen'=>false,
'modal'=>true,
//'position'=>?? //can't find right way to specify this
'width'=>'500px',
'buttons'=>array(
'Add Item'=>'js:addCust',
'Cancel'=>'js:function(){ $(this).dialog("close");}',
),
),
));
?>
<div id="addcust_content"></div>
<?php
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::link('Add Customer', '#', array('onclick'=>'loadAddCust();return false;'));
?>
<script type="text/javascript">
function loadAddCust(){
//ajax load content, then:
$("#addcustdialog").dialog('option','position',[window.innerWidth/2-250,50]);
$("#addcustdialog").dialog("open");
}
</script>
Anyways, those are my thoughts. Like I said, I am loving Yii and plan to be using it heavily over the next six months. Any contributions I can make to better documentation would be well worth my personal time (and perhaps my employer could be made to see the value of my work time to the tune of a couple hours/week going towards this… we’ll see).