DRY MVC视图/控制器分离

I have a custom MVC PHP framework that has a router class, which calls a controller, which uses a model, then the controller presents the view, etc etc.

My problem is that I can't figure out technically how to allow variables to pass between the controller and the view, semantically. I could do a quick-and-dirty fix, but what I want to have is this for a controller:

class IndexController extends Controller{
    var $name = "John"; // instance variable
}

And have this for a view:

<p> <?=$name?> </p>

My question is this:

  1. How can I create a Controller->render() function, or something similar, that allows the view to access instance variables from the controller? and,
  2. How can I do this without doing klutzy things like $data['view']['name'] = "John"; or having to write ten lines of code by default for any new controller I make. I want to do this so it's as DRY as possible.

Thanks.

Edit: FabioCosta's solution

I'm not sure I understand, so far I have my base controller like this:

<?php
    class Controller{
        public function __get($key){
            if(isset($this->$$key)) return $this->$$key;
        }
    }
?>

My base view class looks like this:

<?php
    class View{
         public $controller;
         public function render(){
         $this->controller = $this;
    }
?>

And I initialize from the router like this:

<?php
    $controller = new IndexController();
    $view = new IndexView();
    $view->render();
?>

However, this doesn't work, and I know I'm doing something wrong.

Why not pass the controller that instantiates the view and use the __get magic method?

like so:

  public function __get($key){

      if(isset($this->$key)) return $this->$key;
  }

Here is a working example View.php:

class View{
   protected $_controller;
   public function __construct(Controller $controller){
        $this->_controller=$controller;
   }
   public function render(){
        echo '<h1>Hello '.$this->_controller->name.'</h1>';
   }
}

Controller.php

class Controller{
    protected $name='fabio';
    protected $_myView;

    public function __get($key){

        if(isset($this->$key)) return $this->$key;
   }
    public function __construct(){
        $this->_myView=new View($this);
    }

    public function indexAction(){
        $this->_myView->render();
    }
}

And the router:

$c=new Controller();
$c->indexAction();
  1. Controller should not be responsible for rendering output. That is something view instances should do. Rendering should happen outside the controller.

  2. View should request data from model layer. Then, based on information it received, select the right template, assign data and render this template (or in some cases - group of templates).

Also , router should not initialize neither controllers nor views. Controller should be responsible only for processing the request.