namespace application\controllers;
use application\core\Controller;
use application\models\Letter;
class LetterController extends Controller {
public function indexAction() {
$letterModel = new Letter;
#.......................................
}
public function detailAction() {
$letterModel = new Letter;
#.......................................
}
}
namespace application\controllers;
use application\core\Controller;
use application\models\Letter;
class LetterController extends Controller {
private $letterModel;
function __construct()
{
parent::__construct();
$this->letterModel=new Letter();
}
public function indexAction() {
обращайся $this->letterModel ;
#.......................................
}
public function detailAction() {
обращайся $this->letterModel
#.......................................
}
}