Post by aleksandar1993 » Tue Feb 05, 2019 6:09 pm

Looking my code I cant't load variable from controller to view.
Controller code:

<?php
class ControllerCommonMotorTypeCustom extends Controller {
public function index() {
$data['message'] = 'TEST';
return $this->load->view('common/motor_type_custom', $data);
}
}

My tpl view file:

<div>
<h1> DSA </h1>
<?php var_dump($message); ?>
</div>

Where is my mistake? They write me an undefined variable and everything should be fine. maybe structure folders? Maybe it was not loaded?Maybe I should register somewhere? I really dont' know


Posts

Joined
Mon Jan 14, 2019 6:55 pm

Post by aleksandar1993 » Tue Feb 05, 2019 7:47 pm

Anybody know what happened with this? Any suggestion? Reply?Help?


Posts

Joined
Mon Jan 14, 2019 6:55 pm

Post by kestas » Tue Feb 05, 2019 8:12 pm

Should be

Code: Select all

<div>
<h1> DSA </h1> 
<?php echo $message; ?>
</div>

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by AdieB » Fri Feb 08, 2019 12:40 am

Try

return $this->response->setOutput($this->load->view('common/motor_type_custom', $data));

Newbie

Posts

Joined
Mon May 19, 2014 9:01 pm
Who is online

Users browsing this forum: No registered users and 6 guests