コード例 #1
0
ファイル: Dijit.php プロジェクト: bartolomeu/estoque_gusella
 /**
  * Set view
  *
  * Set view and enable dojo
  *
  * @param  Zend_View_Interface $view
  * @return Zend_Dojo_View_Helper_Dijit
  */
 public function setView(Zend_View_Interface $view)
 {
     parent::setView($view);
     $this->dojo = $this->view->dojo();
     $this->dojo->enable();
     return $this;
 }
コード例 #2
0
ファイル: DojoTest.php プロジェクト: jsnshrmn/Suma
 public function testShouldAllowAddingArbitraryJsToPrimaryDojoScriptTag()
 {
     $this->helper->enable();
     $this->helper->addJavascript('var foo = "bar";');
     $html = $this->helper->__toString();
     $found = false;
     if (preg_match_all('|<script[^>]*>(.*?)(</script>)|s', $html, $m)) {
         foreach ($m[1] as $script) {
             if (strstr($script, 'var foo = "bar";')) {
                 $found = true;
                 break;
             }
         }
     }
     $this->assertTrue($found, 'Js not found: ' . $html);
 }