Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class HTML extends Kohana_HTML {
- public static function tag($name, $attributes=NULL, $type=NULL)
- {
- switch($type)
- {
- case 'open':
- if(is_array($attributes)){
- $tag = "<". $name ." ". html::attributes($attributes) ." >";
- }else{
- $tag = "<". $name ." >";
- }
- break;
- case 'close':
- $tag = "</". $name .">";
- break;
- case NULL:
- default:
- if(is_array($attributes))
- {
- $tag = "<". $name ." ". html::attributes($attributes) ." />";
- }else{
- $tag = "<". $name ." />";
- }
- break;
- }
- return $tag;
- }
- public static function error($msg=NULL, $tag='span', $class='error')
- {
- return is_null($msg) ? '' : html::tag($tag,array('class'=>$class),'open'). $msg .html::tag($tag,NULL,'close');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement