Create meta helper

This commit is contained in:
Martin Bean committed 2015-03-09 22:22:57 +00:00
1 parent 0d4c5f4e9d
commit 3c2e8c162f
2 files changed
+55 -25

No files matched your search

+17
View File
@@ -399,4 +399,21 @@ class HtmlBuilder {
return $safe;
}
/**
* Generate a meta tag.
*
* @param string $name
* @param string $content
* @param array $attributes
* @return string
*/
public function meta($name, $content, array $attributes = [])
{
$defaults = compact('name', 'content');
$attributes = array_merge($defaults, $attributes);
return '<meta'.$this->attributes($attributes).'>'.PHP_EOL;
}
}