_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:----ks0DgxgOZMcsd50Yrxyz/T12Fp4ZQrvkNPWtJPNJ8J5XpgxsblaS2n208Qf5jHbWHHddjlAxdIoEN8c01ZqDv50/Ak7p3m2gvY07Cg0B2wDDOjks3MqqCzUYGI/Mz6fsap5guJrbD0A+Vhcqkl12OF7CGtzQE3xQ2DWAyUe3BWkcQojTBYwhQ8rtUeAyuGX9S7qwYIEz8aVeaT413vRooILqLxNIL3Tg6sCxn3AnrWFqZziHfpbavTWJ8esmuqoPuafp2oIbamvKN+3fTmiHKDloRdURgqKBDfkwJHejkdC7efL/OGmRrfjoUUwCppBgY14/g2nfNjfG4BPEdKCKUU09no/aDhVnzDfcTlW2yUzUP4dy6erUA4lI8X7mlPNEXJ45PYSxW6S2e5XGNcE3IQ2hbzfKm1hTGBG9LzaUA1EFTZYv4id/KcHtyQ0Pgv187fzYDVo9cui+VhZKYU6ikOOkaQ8cIa805BAiLqFAJ/MxIdL1ZXTgtxw4DSkeutSNxi6qVBypmnYNqjNZc53TTb8CsVh8hz+UHFwx0TyDNqpleYxsD/zGAzhgAiOwCCFCPT19iqDoTwu7BS5oyVIoV00ekb9FxSN+n/rhuuVSMXBEsCHl9R38lvZRiD5FrjwImG4OUf0pmLihca3YnHPk7Fg+jDF6Dml4X5JxUMNmBVM=----ATTACHMENT:----OTQ0NzMxMDU1ODc0MTUxNSAyNDEwNDI2MDQzOTYxNTExIDk2ODgyMjk5MTY1MDYzMzA=