CakePHP-2.0 有这个=>
// Even in your cakephp 2.1.x we have this format
<?php
class PostsController extends AppController {
public $helpers = array ('Html','Form');
public $name = 'Posts';
public function index() {
$this->set('posts', $this->Post->find('all'));
}
}
?>
CakePHP-1.3.10 有这个=>
<?php
class PostsController extends AppController {
var $helpers = array ('Html','Form');
var $name = 'Posts';
function index() {
$this->set('posts', $this->Post->find('all'));
}
}
?>
使用 public 和使用 var 有什么区别?