本文整理匯總了PHP中ZurmoHtml::resolveNameID方法的典型用法代碼示例。如果您正苦於以下問題:PHP ZurmoHtml::resolveNameID方法的具體用法?PHP ZurmoHtml::resolveNameID怎麽用?PHP ZurmoHtml::resolveNameID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::resolveNameID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEditableNameIds
/**
* Get the collection of id/names of inputs and other
* parts of the element.
*/
public function getEditableNameIds()
{
$htmlOptions = array();
ZurmoHtml::resolveNameID($this->model, $this->attribute, $htmlOptions);
return array($htmlOptions['id']);
}
示例2: renderDeleteLinkContent
protected function renderDeleteLinkContent()
{
$htmlOptions = array();
$attribute = 'savedSearchId';
ZurmoHtml::resolveNameID($this->model, $attribute, $htmlOptions);
// Begin Not Coding Standard
Yii::app()->clientScript->registerScript('deleteSavedSearchAndRemoveFromViewScript', "\n function deleteSavedSearchAndRemoveFromView(modelId)\n {\n \$.ajax({\n url : '" . Yii::app()->createUrl('zurmo/default/deleteSavedSearch') . "?id=' + modelId,\n type : 'GET',\n dataType : 'json',\n success : function(data)\n {\n var inputId = '" . static::getSavedSearchListDropDown() . "';\n \$('#' + inputId + ' > option').each(function(){\n if (this.value == modelId)\n {\n \$('#' + inputId + ' option[value=\\'' + this.value + '\\']').remove();\n }\n });\n \$('#removeSavedSearch').remove();\n \$('#" . $htmlOptions['id'] . "').val('');\n },\n error : function()\n {\n //todo: error call\n }\n });\n }\n ", CClientScript::POS_END);
// End Not Coding Standard
if ($this->model->savedSearchId != null) {
$label = Zurmo::t('Core', 'Delete') . "<span class='icon'></span>";
return ZurmoHtml::link($label, "#", array('id' => 'removeSavedSearch', 'class' => 'remove', 'onclick' => "deleteSavedSearchAndRemoveFromView('" . $this->model->savedSearchId . "')"));
}
}