Passing variables from controller to view

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Jeroen
New php-forum User
New php-forum User
Posts: 40
Joined: Fri Aug 10, 2012 4:37 pm
Contact:

Re: Passing variables from controller to view

Post by Jeroen » Tue Sep 11, 2012 7:43 am

You set the variable AFTER you do the output

Code: Select all

 public function addresses($arg = false) 
 {
        echo'Addresses '.$arg.'<br />'; //Why output in your controller?
         $this->view->showAddresses = $this->model->getAddresses();  //Where is this method in your code? And you better create a method to set "showAddress" instead of using a public variable.
        $this->view->render('addressesView');

       
 }

Acesystech
New php-forum User
New php-forum User
Posts: 35
Joined: Mon Aug 20, 2012 10:27 pm
Location: Ernakulam
Contact:

Re: Passing variables from controller to view

Post by Acesystech » Thu Sep 13, 2012 11:51 pm


Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest