Php 自定义SyliusFlowBundle渲染

Php 自定义SyliusFlowBundle渲染,php,symfony,symfony-forms,sylius,Php,Symfony,Symfony Forms,Sylius,我正在使用Fuelux向导组件在我的应用程序上设置向导。这是我的模板上的HTML标记: <div class="wizard" data-initialize="wizard" id="myWizard"> <ul class="steps"> <li data-step="1" class="active"><span class="badge">1</span>Step 1<span class="ch

我正在使用Fuelux向导组件在我的应用程序上设置向导。这是我的模板上的HTML标记:

<div class="wizard" data-initialize="wizard" id="myWizard">
    <ul class="steps">
        <li data-step="1" class="active"><span class="badge">1</span>Step 1<span class="chevron"></span></li>
        <li data-step="2"><span class="badge">2</span>Step 2<span class="chevron"></span></li>
        <li data-step="3"><span class="badge">3</span>Step 3<span class="chevron"></span></li>
    </ul>
    <div class="actions">
        <button class="btn btn-default btn-prev"><span class="glyphicon glyphicon-arrow-left"></span>Previous</button>
        <button class="btn btn-default btn-next" data-last="Complete">Next<span class="glyphicon glyphicon-arrow-right"></span></button>
    </div>
    <div class="step-content">
            <div class="step-pane active sample-pane" data-step="1">
                // here goes the firstStep
            </div>
            <div class="step-pane sample-pane " data-step="2">
                // here goes the secondStep
            </div>
            <div class="step-pane sample-pane" data-step="3">
                // here goes the thirdtStep
            </div>
    </div>
</div>

如何将displayAction输出呈现到它应该去的地方?在本例中,文本//此处显示的第一步是?如何管理模板中的Previos/Next链接?

渲染是什么意思?看起来您已经在代码片段中完成了。对于上一个/下一个链接,有$context->getPreviousStep和$context->getNextStep方法,所以在模板中您可以这样做


{{path'sylius_flow_display',{'scenarioAlias':'sylius_flow','stepName':context.previous}}}

@roma kliuchko,当我尝试进入第二步时,我遇到了这个错误,在步骤历史记录中找不到第二步有任何想法吗?这就是我如何使用previos/next链接:{{path'sylius_flow_display',{'scenarioAlias':'RPNIScenario','stepName':'first'}}}对于前一个,我认为这是错误的,因为它将始终转到第一步,而对于下一个{{path'sylius_flow_forward,{'scenarioAlias':'RPNIScenario','stepName':'second}}我认为这也是错误的,因为它总是进入第二步,所以我如何进入下一步/上一步,以及如何修复该错误?@ReynierPM,很抱歉反应太晚。要获得正确的链接,您需要将context对象传递给模板,并在链接的“生成:{{path'sylius_flow_forward',{'scenarioAlias':'RPNIScenario','stepName':context.previousStep}}}中使用它来生成上一步的链接,但与context.nextStep一起生成下一步的链接。@roma kliuchko不担心我理解的延迟,我不知道你在说什么,你能看看我的类,看看上下文如何适应它吗?@ReynierPM我的意思是你需要将$context传递给模板:return$this->render'RPNIBundle:Producto:_paso1.html.twig',array'entity'=>$entity',form=>form->createView,'context'=>$context,并按上面所述生成链接`好的,但是我没有对这个$context变量做任何事情,只是将它设置为一个参数,对吗?我测试并获得了名为context.second的错误步骤
public function displayAction(ProcessContextInterface $context)
{
    $entity = new Producto();
    $form = $this->createForm(new FirstStepFormType(), $entity);

    return $this->render('RPNIBundle:Producto:_paso1.html.twig', array(
                'entity' => $entity,
                'form' => $form->createView())
    );
}