本文整理汇总了PHP中Hubzero\Utility\String::parseAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP String::parseAttributes方法的具体用法?PHP String::parseAttributes怎么用?PHP String::parseAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hubzero\Utility\String
的用法示例。
在下文中一共展示了String::parseAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* Parse Document Content
*
* @return void
*/
public function parse()
{
// check to make sure we have content
if (!$this->get('document')) {
App::abort(406, '\\Components\\Groups\\Helpers\\Document: Requires document to parse');
}
// parse content
// get all group includes
if (preg_match_all('#<group:include([^>]*)/>#', $this->get('document'), $matches)) {
// get number of matches
$count = count($matches[1]);
//loop through each match
for ($i = 0; $i < $count; $i++) {
$attribs = String::parseAttributes($matches[1][$i]);
$type = isset($attribs['type']) ? strtolower(trim($attribs['type'])) : null;
$name = isset($attribs['name']) ? $attribs['name'] : $type;
unset($attribs['type']);
$params = $attribs;
$this->_tags[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'params' => $params);
}
}
// return this
return $this;
}