Views and languages

Views

A views is simply a template file to help you change the look of your wizard quickly and without messing with the script's code. Views are located in the "views" folder. You can either use default views or create your own. To create your own view you need to create a folder in the "views" folder and then a file called "view.php" inside it.

Languages

Language files allow you to store all content that appears throughout the wizard separately from everything else. It makes it very easy to make changes to that content as well as translate it.

Language files are located in the "languages" folder. You may use language strings you add using the $this->language array

For example, lets say you have the following in the language file:

<?php
$language 
= array(
  
'step_1' => 'Welcome to the wizard',
  
'license_number' => 'License number',
  
'license_number_invalid' => 'The license number you typed in is invalid.',
);
?>

Your "includes/steps.php" file may look like this:

<?php
$steps 
= array(
  array(
    
'name' => $this->language['step_1'],
    
'fields' => array(
      array(
        
'type' => 'text',
        
'label' => $this->language['license_number'],
        
'name' => 'license_number',
        
'default' => '0000-0000-0000-0000',
        
'validate' => array(
          array(
'rule' => 'required'),
          array(
            
'rule' => 'validate_license',
            
'error' => $this->language['license_number_invalid']
          )
        )
      )
    )
  )
);
?>

You may also access languages array in the validation and callback methods in a similar fashion.