Integration of an existing Extension with pre-defined HTML and CSS

I am facing issue in integrating http://www.yiiframework.com/extension/wizard-behavior/ plugin.

I have predefined HTML layout according to which the wizard must run but this extension generates forms from inside the model using -


	public function getForm() {

		return new CForm(array(

			'showErrorSummary'=>true,

			'elements'=>array(

				'given_name'=>array(),

				'family_name'=>array(),

				'nickname'=>array(),

				'date_of_birth'=>array()

			),

			'buttons'=>array(

				'submit'=>array(

					'type'=>'submit',

					'label'=>'Next'

				),


			)

		), $this);

	}

so, in View there is just these , last line generating all divs -


<?php

echo $event->sender->menu->run();

echo '<div>Step '.$event->sender->currentStep.' of '.$event->sender->stepCount;

echo '<h3>'.$event->sender->getStepLabel($event->step).'</h3>';


echo CHtml::tag('div',array('class'=>'form'),$form);

?>

What I am not able to do is map these generated HTML to what I already have for ex -


<input name="" class="cssClass" type="text" />

<input id="submit" name="" type="image" src="/images/button/Continue.gif" />

Any pointers will be helpful … :)

You don’t have to generate the forms like this. For example, I did something like this:


		

     	public function userProcessStep($event) {

               switch ($event->step) {

			case 'info':

				$model = new UserInfoForm;

				if(isset($_POST['UserInfoForm']))

				{

					$model->attributes=$_POST['UserInfoForm'];

					if($model->validate())

					{

						$event->sender->save($model->attributes);

						$event->handled = true;

					} else {

						$this->render('/user/infoForm',array('model'=>$model, 'event' => $event));

					}

				} else {

					$this->render('/user/infoForm',array('model'=>$model, 'event' => $event));

				}

				break; ...}

I use my own view (with my own forms) and model files. The wizard demo is just set up like this, but there is no need to do it exactly like this.

k, I am trying to do on similar lines now .

However, in my project there is another extension included from before "yii-user".

After installing the Wizard , it required changes in urlManager as below -


			'urlFormat'=>'path',



After this, yii-user extension does not work with the URL "index.php?r=user" …

You should be able to get to the user module with "index.php/user" now. Read here what changed when you put "urlFormat" => "path":

Yii guide on url management

I can only encourage you to check the the definite guide and the API. Often, the answers or at least valuable hints, are there.