Open framework/yii.php file, override app() static method as follow:
<?php
class Yii extends YiiBase
{
/**
* @static| // A module that can be mixed in to *any object* in order to provide it with | |
| // custom events. You may bind with `on` or remove with `off` callback | |
| // functions to an event; `trigger`-ing an event fires all callbacks in | |
| // succession. | |
| // | |
| // var object = {}; | |
| // _.extend(object, Backbone.Events); | |
| // object.on('expand', function(){ alert('expanded'); }); | |
| // object.trigger('expand'); |
| " ============================================================================= | |
| " << 判断操作系统是 Windows 还是 Linux 和判断是终端还是 Gvim >> | |
| " ============================================================================= | |
| " ----------------------------------------------------------------------------- | |
| " < 判断操作系统是否是 Windows 还是 Linux > | |
| " ----------------------------------------------------------------------------- | |
| let g:iswindows = 0 | |
| let g:islinux = 0 | |
| if(has("win32") || has("win64") || has("win95") || has("win16")) |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
##Main features
| id : (0|(Math.random()*998)), |
| ---------------------|---------------------------------------------- | |
| <Leader>f{char} | Find {char} to the right. See |f|. | |
| <Leader>F{char} | Find {char} to the left. See |F|. | |
| <Leader>t{char} | Till before the {char} to the right. See |t|. | |
| <Leader>T{char} | Till after the {char} to the left. See |T|. | |
| <Leader>w | Beginning of word forward. See |w|. | |
| <Leader>W | Beginning of WORD forward. See |W|. | |
| <Leader>b | Beginning of word backward. See |b|. | |
| <Leader>B | Beginning of WORD backward. See |B|. | |
| <Leader>e | End of word forward. See |e|. |
| function __clone() | |
| { | |
| // 强制复制一份this->object, 否则仍然指向同一个对象 | |
| $this->object1 = clone $this->object1; | |
| } |
| <?php | |
| public function __set($name, $value) | |
| { | |
| $setter = 'set' . $name; | |
| if (method_exists($this, $setter)) { | |
| // set property | |
| $this->$setter($value); | |
| return; | |
| } elseif (strncmp($name, 'on ', 3) === 0) { |
| <?php | |
| /* Besides the methods listed here, this class also has an __invoke method. | |
| * This is for consistency with other classes that implement calling magic, as this method is not used for calling the function. | |
| * by charles | |
| */ | |
| final class Closure { | |
| /** | |
| * This method exists only to disallow instantiation of the Closure class. | |
| * Objects of this class are created in the fashion described on the anonymous functions page. |