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


PHP ZurmoHtml::endForm方法代碼示例

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


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

示例1: run

 /**
  * Override to allow for optional live binding of yiiactiveform. @see $bindAsLive.
  */
 public function run()
 {
     if (is_array($this->focus)) {
         $this->focus = "#" . ZurmoHtml::activeId($this->focus[0], $this->focus[1]);
     }
     echo ZurmoHtml::endForm();
     $cs = Yii::app()->clientScript;
     $cs->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('ext.zurmoinc.framework.views.assets')) . '/FormUtils.js', CClientScript::POS_END);
     if (!$this->enableAjaxValidation && !$this->enableClientValidation || empty($this->attributes)) {
         if ($this->focus !== null) {
             $cs->registerCoreScript('jquery');
             $cs->registerScript('CActiveForm#focus', "\n                        if (!window.location.hash)\n                            { \$('" . $this->focus . "').focus(); }\n                    ");
         }
         return;
     }
     $options = $this->clientOptions;
     if (isset($this->clientOptions['validationUrl']) && is_array($this->clientOptions['validationUrl'])) {
         $options['validationUrl'] = ZurmoHtml::normalizeUrl($this->clientOptions['validationUrl']);
     }
     $options['attributes'] = array_values($this->attributes);
     if ($this->summaryID !== null) {
         $options['summaryID'] = $this->summaryID;
     }
     if ($this->focus !== null) {
         $options['focus'] = $this->focus;
     }
     $options = CJavaScript::encode($options);
     //Not registering via coreScript because it does not properly register when using ajax non-minified
     //on home page myList config view.  Needs a better solution
     $cs->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('system.web.js.source')) . '/jquery.yii.js', CClientScript::POS_END);
     $cs->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('system.web.js.source')) . '/jquery.yiiactiveform.js', CClientScript::POS_END);
     $id = $this->id;
     if ($this->bindAsLive) {
         $cs->registerScript(__CLASS__ . '#' . $id, "\$('#{$id}').live('focus', function(e)\n                {\n                    if (\$(this).data('settings') == undefined)\n                    {\n                        \$(this).yiiactiveform({$options});\n                    }\n                });\n                ");
     } else {
         $cs->registerScript(__CLASS__ . '#' . $id, "\$('#{$id}').yiiactiveform({$options});");
     }
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:41,代碼來源:ZurmoActiveForm.php


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