本文整理匯總了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());
}
}