public function youtube($text)
    {
        return preg_replace_callback($this->pattern['youtube'], function ($matches) {
            $id = is_url($matches[1]) ? Youtube::getId($matches[1]) : $matches[1];

            return $this->Html->youtube($id);
        }, $text);
    }
public function youtube($text)
    {
        return preg_replace_callback($this->pattern['youtube'], function ($matches) {
            $id = is_url($matches[1]) ? Youtube::getId($matches[1]) : $matches[1];

            return $this->Html->youtube($id);
        }, $text);
    }
public function youtube ( $ text ) { return preg_replace_callback ( $ this -> pattern [ 'youtube' ] , function ( $ matches ) { $ id = is_url ( $ matches [ 1 ] ) ? Youtube :: getId ( $ matches [ 1 ] ) : $ matches [ 1 ] ; return $ this -> Html -> youtube ( $ id ) ; } , $ text ) ; }
Parses Youtube code.
You can use video ID or video url.

Examples:
<code>
[youtube]bL_CJKq9rIw[/youtube]
</code>

<code>
[youtube]http://youtube.com/watch?v=bL_CJKq9rIw[/youtube]
</code>
@param string $text Text
@return string
@uses MeTools\Utility\Youtube::getId()
@uses MeTools\View\Helper\HtmlHelper::youtube()
@uses $pattern
Parses Youtube code . You can use video ID or video url .