public function createStockPage($name) { /* @var $inflector \Dewdrop\Inflector */ $inflector = Pimple::getResource('inflector'); $className = '\\Dewdrop\\Admin\\Page\\Stock\\' . $inflector->camelize($name); /* @var $page PageAbstract */ $page = new $className($this->component, $this->request, __DIR__ . '/Stock/view-scripts'); $page->getView()->assignInstance('headlink', $this->view->headLink())->assignInstance('headscript', $this->view->headScript()); return $page; }
/** * Render the submit button for this action. * * @param View $view * @return string */ public function render(View $view) { foreach ($this->stylesheets as $stylesheet) { $view->headLink()->appendStylesheet($stylesheet); } foreach ($this->scriptFiles as $file) { $view->headScript()->appendFile($file); } return sprintf('<input id="%s" name="%s" type="submit" class="%s" value="%s" />', $view->escapeHtmlAttr($this->id), $view->escapeHtmlAttr($this->id), $view->escapeHtmlAttr($this->buttonClassName), $view->escapeHtmlAttr($this->buttonTitle)); }
/** * @return void */ public function testGetHeadscriptFromView() { $headScript = $this->view->headScript(); $this->assertInstanceOf('\\Zend\\View\\Helper\\HeadScript', $headScript); }