simple dialog box feature for Yii

hello everyone, i build a dialog box feature that may be usefull for everyone using yii framework.

Only one component is requiered: DialogBox.php and no more.

The dialogbox opens a jquery-based popup with an action inside. No specific codding for dialog box needed.

hope it will be usefull…



a screen shot, showing you how it looks like, the ‘zipcode’ labeled input element receive the dialog output when it is finished. the dialog runs an action as content body, when user press ‘Finish’ buttton then the dialog box is automatically closed and its return value is passed into the zipcode input box.



[b]please note that the entire dialog content (including control buttons) is a standard Yii action (running inside a iframe), not special codding needed for dialog. if your actions runs directly from your navigator then it runs too into the dialog box.


sample view:

<div id='dialogBoxLaunchIconPosition' style="margin-top: 10px;">

To start testing this dialog box sample, click this icon:

<?php DialogBox::createDialogBox(



   ,"Type your name:"







When dialog is finished then your input is shown here:<br/>

<input id='testinput'></input>


the code for the action response to return the dialog value is as follows:

	public function actionSample()


    	$model=new SampleModel;






            	// form inputs are valid, do something here





    	$this->layout = "dialoglayout";