本文整理汇总了PHP中Generator::variant方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::variant方法的具体用法?PHP Generator::variant怎么用?PHP Generator::variant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator::variant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllKnown
public function getAllKnown()
{
$allDoctypes = array();
foreach ($this->knownMatrix as $category => $instances) {
foreach ($instances as $instance) {
$parentCategory = $category;
$key = $parentCategory . '-' . str_replace('.', '', $instance['version']);
$module = null;
$generator = new Generator();
if ($this->multiline === true) {
$generator->multiline();
}
if ($this->noUri === true) {
$generator->noUri();
}
if ($this->lowercasePrefix === true) {
$generator->lowercasePrefix();
}
if ($this->lowercaseFpi === true) {
$generator->lowercaseFpi();
}
if ($this->uppercaseFpi === true) {
$generator->uppercaseFpi();
}
if ($this->isModuleCategory($parentCategory)) {
$module = $this->getModuleFromCategory($parentCategory);
$parentCategory = $this->getParentCategoryFromModuleCategory($parentCategory);
}
$generator->{$parentCategory}();
$generator->version($instance['version']);
if (!is_null($module)) {
$generator->module($module);
}
if (isset($instance['variant'])) {
$key .= '-' . $instance['variant'];
$generator->variant($instance['variant']);
}
if (isset($instance['moduleVersion'])) {
$key .= '-' . str_replace('.', '', $instance['moduleVersion']);
$generator->moduleVersion($instance['moduleVersion']);
}
$allDoctypes[$key] = $generator->generate();
}
}
return $allDoctypes;
}