本文整理汇总了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});");
}
}