本文整理匯總了PHP中AppHelper::domId方法的典型用法代碼示例。如果您正苦於以下問題:PHP AppHelper::domId方法的具體用法?PHP AppHelper::domId怎麽用?PHP AppHelper::domId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AppHelper
的用法示例。
在下文中一共展示了AppHelper::domId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: insert
/**
* Link to add content to the focused textarea
* @param string $title The content to be wrapped by <a> tags.
* @param string $fieldName This should be "Modelname.fieldname" or specific domId as #id.
* @param mixed $content String or array of markItUp! options (openWith, closeWith, replaceWith, placeHolder and more. See markItUp! documentation for more details : http://markitup.jaysalvat.com/documentation
* @param array $htmlAttributes Array of HTML attributes.
* @param string $confirmMessage JavaScript confirmation message.
* @return string An <a /> element.
*/
public function insert($title, $fieldName = null, $content = array(), $htmlAttributes = array(), $confirmMessage = false)
{
if (isset($fieldName)) {
$content['target'] = $fieldName[0] === '#' ? $fieldName : '#' . parent::domId($fieldName);
}
if (!is_array($content)) {
$content['replaceWith'] = $content;
}
$properties = '';
foreach ($content as $k => $v) {
$properties .= $k . ':"' . addslashes($v) . '",';
}
$properties = substr($properties, 0, -1);
$htmlAttributes = array_merge($htmlAttributes, array('onclick' => '$.markItUp( { ' . $properties . ' } ); return false;'));
return $this->Html->link($title, "#", $htmlAttributes, $confirmMessage, false);
}