HtmlInput : add a new function to create an empty anchor
This commit is contained in:
parent
4b7d3dfa89
commit
6c851b3dc1
1 changed files with 18 additions and 0 deletions
|
|
@ -723,6 +723,24 @@ class HtmlInput
|
|||
$r.=h2($name,' class="title" ');
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* @brief let you create only a link and set an id on it.
|
||||
* After create a javascript for getting the event
|
||||
* onclick = function() {...}
|
||||
* @param type $p_text Text to display
|
||||
* @param type $p_id id of the link
|
||||
* @code
|
||||
* echo HtmlInput::anchor_empty('go','go_id');
|
||||
* <script>$("go_id").onclick=function (e) { ...}</script>
|
||||
* @endcode
|
||||
*/
|
||||
static function anchor_empty($p_text,$p_id)
|
||||
{
|
||||
$p_url="javascript:void(0)";
|
||||
$str=sprintf('<a id="%s" href="javascript:void(0)" class="line">%s</a>',
|
||||
$p_id,$p_text);
|
||||
return $str;
|
||||
}
|
||||
/**
|
||||
*Return a simple anchor with a url or a javascript
|
||||
* if $p_js is not null then p_url will be javascript:void(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue