resolver = $resolver; } /** * {@inheritDoc} */ public function resolve($name, RendererInterface $renderer = null) { $plugin = array($renderer, 'plugin'); if (! is_callable($plugin)) { return false; } $helper = call_user_func($plugin, 'view_model'); if (! $helper instanceof ViewModelHelper) { return false; } $currentModel = $helper->getCurrent(); if (! $currentModel instanceof ModelInterface) { return false; } $currentTemplate = $currentModel->getTemplate(); $position = strrpos($currentTemplate, self::NS_SEPARATOR); if (! $position) { return false; } return $this->resolver->resolve(substr($currentTemplate, 0, $position) . self::NS_SEPARATOR . $name, $renderer); } }