Created
July 18, 2011 14:42
-
-
Save makasim/1089711 to your computer and use it in GitHub Desktop.
wizard controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Controller | |
namespace Rj\EmployerBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
class AdWizardController extends Controller | |
{ | |
public function showStep($identifier) | |
{ | |
//http://symfony.com/doc/2.0/book/translation.html | |
return new Response($this->renderStep($this->getWizard()->step($identifier))); | |
} | |
public function processStep($identifier) | |
{ | |
$step = $this->getWizard()->step($identifier); | |
$step->process(); | |
if ($step->finished()) { | |
$step = $this->getWizard()->nextFor($identifier); | |
} | |
$this->redirect('rj_employer_wizard_show_step', array('identifier' => $step->getIdentifier())); | |
} | |
protected function renderStep($step) | |
{ | |
return $this->renderView($step->getTemplate(), array('step' => $step)); | |
} | |
protected function getWizard() | |
{ | |
return $this->get('rj_employer_ad_wizard'); | |
} | |
} | |
// DIC | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment