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