Liip\RMT\Context::getInstance PHP Method

getInstance() public static method

public static getInstance ( ) : Context
return Context
    public static function getInstance()
    {
        if (self::$instance == null) {
            self::$instance = new self();
        }
        return self::$instance;
    }

Usage Example

Example #1
0
 protected function executeActionListIfExist($name, $title = null)
 {
     $actions = Context::getInstance()->getList($name);
     if (count($actions) > 0) {
         $this->getOutput()->writeSmallTitle($title ?: ucfirst($name));
         $this->getOutput()->indent();
         foreach ($actions as $num => $action) {
             $this->getOutput()->write(++$num . ') ' . $action->getTitle() . ' : ');
             $this->getOutput()->indent();
             $action->execute();
             $this->getOutput()->writeEmptyLine();
             $this->getOutput()->unIndent();
         }
         $this->getOutput()->unIndent();
     }
 }
All Usage Examples Of Liip\RMT\Context::getInstance