how I can load controller in my view file

Permalink 1 user found helpful
how I can load controller in my view file?

 
hamsterbacke82 replied on at Permalink Reply
At least in a block view file, the controller is already available:
$this->controller
Maybe it's the same for other views as well.
sonugoyal replied on at Permalink Reply
Thank for your help, now i have another issue.
controller is called but when i use
In controller
$this->set("job","Designer");


In View
echo "job value".$job;


but not found $job value ??
hamsterbacke82 replied on at Permalink Reply
Where are you doing the $this->set()?

Something like this should work:
public function view() {
    $this->set('job', 'designer'); 
  }
sonugoyal replied on at Permalink Best Answer Reply
Yes thanks ,its working for me in
public function view().

but I create my custom function in controller like that.

In Controller
public function testfunction()
{

$this->set('job',"Programmer");
}


this should also work, how we can access from custom function??