Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Tuesday, 9 June 2015

Yii: jQuery UI widget dialog with ok and close buttons.

Yii: jQuery UI widget dialog with ok and close buttons.

<?php
$this->beginWidget('system.zii.widgets.jui.CJuiDialog',
array(
'id'=>'dialog'.$this->id,
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>$this->id.' Dialog box 1',
'width'=> '800px',
'height' => '600',
'position' => 'top',
'top' => '50px',
'modal' => true,
'buttons' => array(
"Ok"=>'js:function(){alert("xxx")}',
'Close'=>'js:function() {$(this).dialog("close");}'
),
'autoOpen'=>false,
)
)
);
?>

Reference:

Tuesday, 26 May 2015

Include CSS and JS files in Yii 1.1

$baseUrl = Yii::app()->baseUrl; 
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($baseUrl.'/js/yourscript.js');
$cs->registerCssFile($baseUrl.'/css/yourcss.css');
Reference:

Parenting tips to inculcate learning habits in your kid

Parenting tips to inculcate learning habits in your kid Tip #1) Children do not learn things, they emitate. So, try to do things by yours...