I trying to pass $variable from CodeIgniter controller to a view but it's fail.
My controller code is:
class Index_controller extends CI_Controller {
public function index(){
$formURL = base_url().index_page().'authorization_controller/authorization';
$attributes = array('class' => 'authorization','id' => 'authorization');
$this->load->view('header');
$this->load->view('leftFrame', $formURL, $attributes);
$this->load->view('rightFrame');
$this->load->view('index');
$this->load->view('footer');
}
}
My view code is:
<?php echo form_open($formURL, $attributes); ?>
</form>
Error message:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: formURL
and
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: attributes