I've created a view form_variables.php that contains all the form input variables defined in a single file. So that whenever i need to create an input field, i would simply include the form_variables file and then use the form input variables defined in the form_variables.php
Here's what it contains.
<?php $email = array( 'name' => 'u_email', 'type' => 'text', 'maxlength' => '50', 'class' => 'form-control', 'value' => set_value('e_email'), 'placeholder' => "Enter your Email Address" ); $pwd = array( 'name' => 'u_pwd', 'type' => 'password', 'maxlength' => '50', 'class' => 'form-control', 'id' => 'pwd', 'placeholder' => "Enter your Password" ); ?>
Now i have another view that contains the form.
<?php echo $this->load->view('includes/form_variables'); ?> <div class="form-group"> <?php echo form_input($email); ?> </div>
It still says that the variable $email is undefined. Although it loads the form_variables.php file. Please Help.