【发布时间】:2011-06-28 09:23:10
【问题描述】:
每当我应该从模型或控制器发送邮件时,我都无法确定。事情是在我使用的控制器中
这是关于 PHP 的。
在控制器中:
if (Post::get()){
$this->model->registerUser( ... );
$this->model->mailSendUserActivation();
// assign something to view.
}
在模型中:
public function mailSendUserActivation(){
$mail = new \com\Mail();
// assign stuff to mail from API classes and other functions in model.
$mail->send();
}
这是正确的吗?还是真的应该从控制器发送邮件?
【问题讨论】:
标签: php model-view-controller model controller php-5.3