public static function highlighter(array $terms, $start = 'highlighter-start', $end = 'highlighter-end', $className = 'highlight', $tag = 'span')
	{
		$sig = md5(serialize(array($terms, $start, $end)));
		if (isset(self::$loaded[__METHOD__][$sig]))
		{
			return;
		}

		$script = 'assets/jquery.highlight.js';
		if (App::get('config')->get('debug'))
		{
			$script = 'assets/jquery.highlight.min.js';
		}
		Asset::script($script, true, true);

		$terms = str_replace('"', '\"', $terms);

		$options = "{
			className: '" . $className . "',
			element: '" . $tag . "'
		}";

		App::get('document')->addScriptDeclaration("
			jQuery(document).ready(function($){
				$('body').highlight([\"" . implode('","', $terms) . "\"], " . $options . ");
			});
		");

		self::$loaded[__METHOD__][$sig] = true;

		return;
	}
public static function highlighter(array $terms, $start = 'highlighter-start', $end = 'highlighter-end', $className = 'highlight', $tag = 'span')
	{
		$sig = md5(serialize(array($terms, $start, $end)));
		if (isset(self::$loaded[__METHOD__][$sig]))
		{
			return;
		}

		$script = 'assets/jquery.highlight.js';
		if (App::get('config')->get('debug'))
		{
			$script = 'assets/jquery.highlight.min.js';
		}
		Asset::script($script, true, true);

		$terms = str_replace('"', '\"', $terms);

		$options = "{
			className: '" . $className . "',
			element: '" . $tag . "'
		}";

		App::get('document')->addScriptDeclaration("
			jQuery(document).ready(function($){
				$('body').highlight([\"" . implode('","', $terms) . "\"], " . $options . ");
			});
		");

		self::$loaded[__METHOD__][$sig] = true;

		return;
	}
public static function highlighter ( array $ terms , $ start = 'highlighter-start' , $ end = 'highlighter-end' , $ className = 'highlight' , $ tag = 'span' ) { $ sig = md5 ( serialize ( array ( $ terms , $ start , $ end ) ) ) ; if ( isset ( self :: $ loaded [ __METHOD__ ] [ $ sig ] ) ) { return ; } $ script = 'assets/jquery.highlight.js' ; if ( App :: get ( 'config' ) -> get ( 'debug' ) ) { $ script = 'assets/jquery.highlight.min.js' ; } Asset :: script ( $ script , true , true ) ; $ terms = str_replace ( '"' , '\"' , $ terms ) ; $ options = "{
			className: '" . $ className . "',
			element: '" . $ tag . "'
		}" ; App :: get ( 'document' ) -> addScriptDeclaration ( "
			jQuery(document).ready(function($){
				$('body').highlight([\"" . implode ( '","' , $ terms ) . "\"], " . $ options . ");
			});
		" ) ; self :: $ loaded [ __METHOD__ ] [ $ sig ] = true ; return ; }
Highlight some words via Javascript.

@param   array   $terms      Array of words that should be highlighted.
@param   string  $start      ID of the element that marks the begin of the section in which words
should be highlighted. Note this element will be removed from the DOM.
@param   string  $end        ID of the element that end this section.
Note this element will be removed from the DOM.
@param   string  $className  Class name of the element highlights are wrapped in.
@param   string  $tag        Tag that will be used to wrap the highlighted words.
@return  void
Highlight some words via Javascript .