Extending CJuiDialog

You are viewing revision #1 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#2) »

Sometimes you have CJuiDialog with different content but same buttons (or width, height). If you don't want to repeat yourself this is a great solution:


> extensions/dialog/start.php

In start.php write:

class Start extends CJuiDialog
        public function init()
                     'Save'=>'js:function(){alert("alert one");}',      
                     'Cancel'=>'js:function(){alert("alrt two");}', 



Somewhere (in views) create:

$this->beginWidget('ext.dialog.start', array(

And that's it. You will have buttons Save and Cancel everytime.