return HtmlA::setHref($url)->setContent($url); }); Larakit\Twig::register_function('html_audio', function ($src) { return HtmlAudio::setSrc($src); }); Larakit\Twig::register_function('html_abbr', function ($abbr, $fulltext) { return HtmlAbbr::setContent($abbr)->setTitle($fulltext); }); Larakit\Twig::register_function('html_blockquote', function ($content, $author = null) { return HtmlBlockquote::setContent($content)->setAuthor($author); }); Larakit\Twig::register_function('html_button', function ($content) { return HtmlButton::setContent($content); }); Larakit\Twig::register_function('html_div', function ($content = null) { return HtmlDiv::setContent($content); }); Larakit\Twig::register_function('html_i', function ($content = null) { return HtmlI::setContent($content); }); Larakit\Twig::register_function('html_span', function ($content = null) { return HtmlSpan::setContent($content); }); Larakit\Twig::register_function('html_strike', function ($content = null) { return HtmlStrike::setContent($content); }); Larakit\Twig::register_function('html_strong', function ($content = null) { return HtmlStrong::setContent($content); }); Larakit\Twig::register_function('html_sup', function ($content = null) { return HtmlSup::setContent($content);
function actionBelongsToMany($relation, $icon = 'fa fa-sitemap', $title = null) { if (!Acl::factory($this->model)->reason('edit')) { $list = \HtmlOl::addClass('js-hasmany'); foreach ($this->model->{$relation} as $item) { $list->addItem($item); } $model_class = get_class($this->model); if ($title) { $translated_title = $model_class::translate($title); } else { $translated_title = \Lang::get('larakit::relations.hint.belongs_to_many'); } $btn = \HtmlButton::setAttribute('data-action', 'belongs_to_many')->setAttribute('data-relation', $relation)->addClass('btn btn-primary btn-xs js-btn ')->setTitle($translated_title)->setContent('<i class="' . $icon . '"></i>'); return \HtmlDiv::addClass('row-fluid')->setContent(\HtmlDiv::addClass('pull-left')->setContent($btn) . \HtmlDiv::setContent($list)); } return ''; }