當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTML_QuickForm2_Renderer::getJavascriptBuilder方法代碼示例

本文整理匯總了PHP中HTML_QuickForm2_Renderer::getJavascriptBuilder方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTML_QuickForm2_Renderer::getJavascriptBuilder方法的具體用法?PHP HTML_QuickForm2_Renderer::getJavascriptBuilder怎麽用?PHP HTML_QuickForm2_Renderer::getJavascriptBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTML_QuickForm2_Renderer的用法示例。


在下文中一共展示了HTML_QuickForm2_Renderer::getJavascriptBuilder方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     if (method_exists($renderer->getJavascriptBuilder(), 'addValidateJs')) {
         $renderer->getJavascriptBuilder()->addValidateJs('errorElement: "span"');
     }
     return parent::render($renderer);
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:7,代碼來源:Admin.php

示例2: render

 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     // render as a normal select when frozen
     if ($this->frozen) {
         $renderer->renderElement($this);
     } else {
         $jsBuilder = $renderer->getJavascriptBuilder();
         $this->renderClientRules($jsBuilder);
         $jsBuilder->addLibrary('dualselect', 'dualselect.js', 'js/', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR);
         $keepSorted = empty($this->data['keepSorted']) ? 'false' : 'true';
         $jsBuilder->addElementJavascript("qf.elements.dualselect.init('{$this->getId()}', {$keepSorted});");
         // Fall back to using the Default renderer if custom one does not have a plugin
         if ($renderer->methodExists('renderDualSelect')) {
             $renderer->renderDualSelect($this);
         } else {
             $renderer->renderElement($this);
         }
     }
     return $renderer;
 }
開發者ID:andreaswarnaar,項目名稱:HTML_QuickForm2.1,代碼行數:20,代碼來源:dualselect.php

示例3: render

 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $renderer->getJavascriptBuilder()->addElementJavascript($this->getJs());
     return parent::render($renderer);
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:5,代碼來源:sliiing.php

示例4: render

 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $renderer->renderHidden($this);
     $this->renderClientRules($renderer->getJavascriptBuilder());
     return $renderer;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:6,代碼來源:InputHidden.php

示例5: render

 /**
  * Renders the form using the given renderer
  *
  * @param    HTML_QuickForm2_Renderer    Renderer instance
  * @return   HTML_QuickForm2_Renderer
  */
 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $renderer->startForm($this);
     $renderer->getJavascriptBuilder()->setFormId($this->getId());
     foreach ($this as $element) {
         $element->render($renderer);
     }
     $this->renderClientRules($renderer->getJavascriptBuilder());
     $renderer->finishForm($this);
     return $renderer;
 }
開發者ID:sergiokessler,項目名稱:perio,代碼行數:17,代碼來源:QuickForm2.php

示例6: render

 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $renderer->getJavascriptBuilder()->addLibrary('bricks-editor', 'bricks-editor.js', REL_ROOT_URL . '/application/default/views/public/js');
     return parent::render($renderer);
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:5,代碼來源:BricksEditor.php

示例7: render

    public function render(HTML_QuickForm2_Renderer $renderer)
    {
        $id = $this->getId();
        $url = REL_ROOT_URL . '/application/default/views/public/js/ckeditor/ckeditor.js';
        $renderer->getJavascriptBuilder()->addElementJavascript(<<<CUT
if (!window.CKEDITOR) {            
    var script = \$('<script type="text/javascript" src="{$url}"></' + 'script>');  
    \$('head').append(script);    
}
CUT
);
        if (!$this->dontInitMce) {
            $options = $this->mceOptions ? Am_Controller::getJson($this->mceOptions) : '{}';
            $renderer->getJavascriptBuilder()->addElementJavascript(<<<CUT
\$(function(){            
    initCkeditor('{$id}', {$options});
});
CUT
);
        }
        return parent::render($renderer);
    }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:22,代碼來源:Form.php

示例8: render

 /**
  * Renders the element using the given renderer
  *
  * @param    HTML_QuickForm2_Renderer    Renderer instance
  * @return   HTML_QuickForm2_Renderer
  */
 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     foreach ($this->rules as $rule) {
         if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
             $renderer->getJavascriptBuilder()->addRule($rule[0]);
         }
     }
     $renderer->renderElement($this);
     return $renderer;
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:16,代碼來源:Element.php

示例9: getJavascriptBuilder

 public function getJavascriptBuilder()
 {
     return $this->_renderer->getJavascriptBuilder();
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:4,代碼來源:Proxy.php

示例10: render

 /**
  * Renders the container using the given renderer
  *
  * Container will be output N + 1 times, where N are visible items and 1 is
  * the hidden prototype used by Javascript code to create new items.
  *
  * @param HTML_QuickForm2_Renderer $renderer renderer to use
  *
  * @return   HTML_QuickForm2_Renderer
  */
 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $backup = $this->backupChildAttributes(true, true);
     $hiddens = $renderer->getOption('group_hiddens');
     $jsBuilder = $renderer->getJavascriptBuilder();
     $evalBuilder = new HTML_QuickForm2_Container_Repeat_JavascriptBuilder();
     $renderer->setJavascriptBuilder($evalBuilder)->setOption('group_hiddens', false)->startContainer($this);
     // first, render a (hidden) prototype
     $this->getPrototype()->addClass('repeatItem repeatPrototype');
     $this->getPrototype()->render($renderer);
     $this->getPrototype()->removeClass('repeatPrototype');
     // restore original JS builder
     $evalBuilder->passLibraries($jsBuilder);
     $renderer->setJavascriptBuilder($jsBuilder);
     // next, render all available rows
     foreach ($this->getIndexes() as $index) {
         $this->replaceIndexTemplates($index, $backup);
         /* @var HTML_QuickForm2_Node $child */
         foreach ($this->getRecursiveIterator() as $child) {
             if (isset($this->childErrors[$hash = spl_object_hash($child)]) && isset($this->childErrors[$hash][$index])) {
                 $child->setError($this->childErrors[$hash][$index]);
             }
         }
         $this->getPrototype()->render($renderer);
     }
     $this->restoreChildAttributes($backup);
     // only add javascript if not frozen
     if (!$this->toggleFrozen()) {
         $jsBuilder->addLibrary('repeat', 'quickform-repeat.js');
         $jsBuilder->addElementJavascript($this->_generateInitScript($evalBuilder));
         $this->renderClientRules($jsBuilder);
     }
     $renderer->finishContainer($this);
     $renderer->setOption('group_hiddens', $hiddens);
     return $renderer;
 }
開發者ID:andreaswarnaar,項目名稱:HTML_QuickForm2.1,代碼行數:46,代碼來源:Repeat.php

示例11: render

 /**
  * Renders the container using the given renderer
  *
  * @param    HTML_QuickForm2_Renderer    Renderer instance
  * @return   HTML_QuickForm2_Renderer
  */
 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     foreach ($this->rules as $rule) {
         if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
             $renderer->getJavascriptBuilder()->addRule($rule[0]);
         }
     }
     $renderer->startContainer($this);
     foreach ($this as $element) {
         $element->render($renderer);
     }
     $renderer->finishContainer($this);
     return $renderer;
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:20,代碼來源:Container.php


注:本文中的HTML_QuickForm2_Renderer::getJavascriptBuilder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。