本文整理汇总了PHP中Wizard::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Wizard::get方法的具体用法?PHP Wizard::get怎么用?PHP Wizard::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wizard
的用法示例。
在下文中一共展示了Wizard::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tagWizard
/**
* Renders a wizard section. Each wizard section must be defined in the controller and a wizard section must
* corrospond to a method in the controller
* @param string id | id of the section
* @container
*/
protected function tagWizard($attrs)
{
$current = Pimple::instance()->getAction();
$w = Wizard::get($attrs->id);
if ($w) {
$cs = $w->getStep($current);
}
if ($cs) {
$title = '<ul class="horizontal divided">';
$before = true;
foreach ($w->getSteps() as $s) {
if ($s->getId() == $current) {
$title .= sprintf('<li class="active">%s</li>', $s->getTitle());
$before = false;
} else {
$add = '';
if ($before) {
$add = ' class="done"';
}
if ($cs->canJumpTo($s->getId())) {
$title .= sprintf('<li%s><a href="%s">%s</a></li>', $add, Url::makeLink(Pimple::instance()->getController(), $s->getId()), $s->getTitle());
} else {
$title .= sprintf('<li%s>%s</li>', $add, $s->getTitle());
}
}
}
$title .= '</ul>';
return sprintf('<div class="panel wizard %s"><h2>%s<strong>' . T('Step %s of %s', $cs->getStep(), $w->getNumSteps()) . '</strong></h2>%s</div>', $attrs->class, $title, $this->body());
} else {
return sprintf('<div class="panel">%s</div>', $this->body());
}
}