This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1st approach | |
public function registerCallback( $callback, int $delay, $arguments=array(), $repeat=false ) { | |
//...the function that exist | |
//Add return the key of the callback if registered | |
return callback key; | |
} | |
public functio registerTabCall( $callback , $array( sec, min , hour , dayOfTheWeek ) , $repeate=false) { | |
$firstdelay = calculate delay from now for the first call; | |
$key = $this->registerCallback(...., $firstdelay , ... ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function ownedBy($memId) | |
{ | |
$this->getDbCriteria()->mergeWith(array( | |
'condition'=>'t.mem_id='.(int)$memId | |
)); | |
return $this; | |
} | |
public function relations() | |
{ | |
return array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
that.onHashChange=function(data) { | |
//Hash change triggers before yillist is ready. | |
$(document).ready(function() { | |
var ajaxUrl = c.updateUrl; | |
if(typeof(data)!='undefined') { | |
ajaxUrl = ajaxUrl+'?'+$.param(data); | |
_general(data); | |
} | |
$.fn.yiiListView.update(c.yiiListID, { url: ajaxUrl }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JsModule extends CWidget | |
{ | |
... | |
protected $defaultOptions = array(); | |
... | |
public function init() | |
{ | |
$this->options = CMap::mergeArray($this->defaultOptions, $this->options); | |
//registerscrits etc.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function searchStarredMembers( $tag=null, $keyword=null, $myStar = true) | |
{ | |
$with = array('myMemberStar'); | |
if(isset($tag)) { | |
if($tag) { | |
$with = array( | |
'myMemberStar'=>array( | |
'with'=> array( | |
'starToTags'=>array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class StreamItem { | |
//....... | |
public function relations() | |
{ | |
return array( | |
'stream' => array(self::BELONGS_TO, 'Stream', 'stream_id'), | |
'message' => array(self::BELONGS_TO, 'StreamMessage', 'msg_id'), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return arrray( | |
'components' => array( | |
'myComponent' => array( | |
'class' => 'ext.foo.FooComponent', | |
.... | |
) | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param bool $myProfile If the profile is mine | |
* @pararm CActiveDataProvider $dataProvider jobs I haved posted | |
*/ | |
.... | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->jsPage = $this->createWidget('JsPageTest', array( | |
'config' => true | |
)); | |
//If your page is named like JsPage{ControllerID}{ActionID} | |
//you can also do | |
$this->jsPage = array('config'); |
OlderNewer