コード例 #1
0
ファイル: Rte.php プロジェクト: jeremymoorecom/Smallunch
 /**
  * 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);
 }
コード例 #2
0
 protected function getPlaceholder()
 {
     if (is_null($this->_placeholder)) {
         $this->_placeholder = parent::placeholder('customJavascript');
     }
     return $this->_placeholder;
 }
コード例 #3
0
 public function testDefaultEmpty()
 {
     $this->_view->renderToPlaceholder('rendertoplaceholderscript.phtml', 'fooPlaceholder');
     $placeholder = new Zend_View_Helper_Placeholder();
     $this->assertEquals("Foo Bar\n", $placeholder->placeholder('fooPlaceholder')->getValue());
 }
コード例 #4
0
ファイル: PlaceholderTest.php プロジェクト: alab1001101/zf2
 /**
  * @return void
  */
 public function testPlaceholderRetrievesSameContainerOnSubsequentCalls()
 {
     $container1 = $this->placeholder->direct('foo');
     $container2 = $this->placeholder->direct('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);
 }
コード例 #6
0
ファイル: Abstract.php プロジェクト: roed/zend-mvc-extend
 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());
 }