public function action_new()
{
// set our default form template to load
$form = 'vehicles/add/form_step1';
// get uri
$uri = \Uri::segment(4);
// if we have a post action
if (\Input::post())
{
if (\Input::post('step1_submit'))
{
\Session::set('step1_values', array(
'name' => \Input::post('name'),
'email' => \Input::post('email'),
'phone' => \Input::post('phone'),
));
}
}
// switch our uri to decide course of action
switch ($uri)
{
case 'step-1':
$form = 'vehicles/add/form_step1';
if (\Session::get('step1_values'))
{
$values = \Session::get('step1_values');
}
break;
case 'step-2':
$form = 'vehicles/add/form_step2';
break;
}
$content = \Theme::instance('vehicle_add');
$content->set_template('vehicles/add_new');
if (isset($values))
{
$content->set_partial('form', $form)->set('values', $values);
}
else
{
$content->set_partial('form', $form);
}
$theme = \Theme::instance();
$theme->set_partial('content', $content);
}
It looks like you're new here. If you want to get involved, click one of these buttons!