a1exlism
10/24/2017 - 6:20 AM

CI_loadview_with_variable

------------------------1---------------------
>Controller
<?
function index($value) {

    $data['value'] = $value;
    $this -> load -> view('cms/template', $data);
} ?>

>View

<?php print_r($value);?>



------------------------2---------------------
>Controller
<?
$val = 'test';
$this->load->view('views'); ?>

>View
<?php echo($this->$val); ?>