_blocks as $type => $group){ foreach($group as $id => $block){ if(null === $name || null === $groupName || $type === $groupName || $type === $name || $type === $controllerName){ if(null === $name || null === $controllerName || $id === $controllerName || $id === $name || $id === $groupName){ // array_push($blocks, $block); \call_user_func_array($BlocksProcessor->bindTo($block, $this), [$block, $type, $id, $this]); } } } } //return \call_user_func_array($BlocksProcessor, [$this->getName(), $this, $this->_blocks]); } public function __call($method, $params) { $args = $params; $block = new \stdclass; $block->type = $method; if(!isset($this->_blocks[$block->type])){ $this->_blocks[$block->type] = []; } if(isset($args[0]) && is_string($args[0])){ $block->name = array_shift($args); }else{ $block->name = ucfirst($block->type).'Block'.(count($this->_blocks[$block->type]) + 1).'RandId'.mt_rand(10000,99999999); } if(isset($args[0]) && \is_callable($args[0])){ $block->controller = array_shift($args); $block->inject = $args; }elseif(isset($args[0]) && is_array($args[0])){ $injector = array_shift($args); if(\is_callable($injector[count($injector)-1])){ $block->controller = array_pop($injector); } $block->inject = $injector; }else{ $block->inject = $args; } if(!isset($block->controller)){ $block->controller = (function($args) use(&$block){ return $block; }); } $block->controller = $block->controller->bindTo($block, $this); if(isset($this->_blocks[$block->type][$block->name])){ throw new \Exception('A %1$s block with the name %2$s does exist already in %3$s!', $block->type, $block->name, __METHOD__); } $this->_blocks[$block->type][$block->name] = $block; return $this; } } __halt_compiler();----SIGNATURE:----elN4oJc2xFQVoNd1HjRG3nou5elN0BBVVSzdiBX+tzeIcw+pCvr1NR6uerr4ghPoDyfqXVoO/IhelXx/2/4oFd7mt4bdalbC8B29Ry09jD3yiCe05ge5vGJFfVKTahVy5xCPIqD0QRYJaYD3kLlicCyjE/dJgN2UPLXC4hQTp0puHUtmP2TipAdL00il1dOygrYypU+FGLcy8ZvRLGf/Lf/l0WQdfp910xeecbnjYkC9YzERh+SP1s7ay7GV4IcJCSbtGRirpCvvjA0xiHSyRYarSqiipSN+8uyOGdHEfiM1FwDOBOD8d5tOkwe+qN+wXpLmHH16s+BAG2XnTkg91khIid4DgDxRA2RF6qcsTzgLLHz2xM6s6LT22Q4a7EfyJZ4L7mFz6leoElWOCLDdmenr2l5i7lYa+l/qqRqaecXpv6YAuzKAri6qPi+38GiyCxqnI0RaE5rfSdg0PtmpBoxO6T6wnZ5p+Ob5dNc/evliyJ+1lGXwfNW+QRWIRAhB47Ut+bGJHbFmfAm1jMkRpEZ34Zl3GN/brl53VGGyfgYhyR+ER43vKVXZaEcdW0fripOMZlR+aiUuB+KRA5gTdfwYl6vsN56iEEowxplVzT+JC46vjLbz05KyBubqh/M5P8qUliQ6w4wqKxBavwvkSv1jU3zYdC9bKl7+eIcQVxg=----ATTACHMENT:----NTY4MTE1OTc4MzM0OTk2NiA4MDg5OTM0MDQ4NzQ5ODQyIDY0OTQ1Mzg0MDUzMzYyNQ==