/** * Returns CKEditor form field * @param string $name Name used for generated field * @param string $value Content for CKEditor * @param array $attr Attributes for textarea */ function rte($name, $value = null, $attr = array()) { $baseUrl = str_replace('/index.php', '', str_replace('/dev.php', '', Zend_Controller_Front::getInstance()->getBaseUrl())); $headLink = new Zend_View_Helper_HeadLink(); $headScript = new Zend_View_Helper_HeadScript(); $headScript->headScript()->appendFile($baseUrl . '/js/ckeditor/ckeditor.js'); $placeholder = new Zend_View_Helper_Placeholder(); $placeholder->placeholder('jQuery')->captureStart(); echo "CKEDITOR.replace( '" . $name . "' );"; $placeholder->placeholder('jQuery')->captureEnd(); return $this->view->formTextarea($name, $value, $attr); }
protected function getPlaceholder() { if (is_null($this->_placeholder)) { $this->_placeholder = parent::placeholder('customJavascript'); } return $this->_placeholder; }
public function testDefaultEmpty() { $this->_view->renderToPlaceholder('rendertoplaceholderscript.phtml', 'fooPlaceholder'); $placeholder = new Zend_View_Helper_Placeholder(); $this->assertEquals("Foo Bar\n", $placeholder->placeholder('fooPlaceholder')->getValue()); }
/** * @return void */ public function testPlaceholderRetrievesSameContainerOnSubsequentCalls() { $container1 = $this->placeholder->placeholder('foo'); $container2 = $this->placeholder->placeholder('foo'); $this->assertSame($container1, $container2); }
/** * テンプレートを処理し、結果を出力します * * @param string $name 処理するテンプレート * * @return string 出力結果 */ public function render($name) { // プレイスホルダヘルパーが保持するコンテンツ情報を取得 $holder = new Zend_View_Helper_Placeholder(); $data = $holder->placeholder('Zend_Layout')->getArrayCopy(); // コンテンツ情報をビュー変数contentに割り当て if (isset($data['content'])) { $this->_smarty->assign('content', $data['content']); } return $this->_smarty->fetch($name); }
public function getChildHtml($name = "") { $helper = new Zend_View_Helper_Placeholder(); $helper->placeholder($this->getName())->set(''); if (!empty($name)) { if (isset($this->_blocks[$name])) { $block = $this->_blocks[$name]; $helper->placeholder($this->getName())->append($block->toHtml()); } } else { $helper = new Zend_View_Helper_Placeholder(); foreach ($this->getBlocks() as $block) { $helper->placeholder($this->getName())->append($block->toHtml()); } } return $helper->getRegistry()->getContainer($this->getName()); }