小编ims*_*med的帖子

如何使用codeigniter中的View发送包含内容的电子邮件

我想从我的应用程序向用户发送一封电子邮件,其中包含从视图中加载的电子邮件的内容 .这是我到目前为止尝试过的代码:

$toemail = "user@email.id";

$subject = "Mail Subject is here";
$mesg = $this->load->view('template/email');

$this->load->library('email');

$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

$this->email->initialize($config);

$this->email->to($toemail);
$this->email->from($fromemail, "Title");
$this->email->subject($subject);
$this->email->message($mesg);
$mail = $this->email->send();
Run Code Online (Sandbox Code Playgroud)

php codeigniter

6
推荐指数
2
解决办法
3万
查看次数

使用TableGateway选择功能设置参数显示错误未定义变量

我在我的模型中创建一个函数,如:

public function getAllMenuByOnlyActionPage($actionlot){

            $act  = trim($actionlot);
            $result = $this->tableGateway->select(function (Select $select) {
                        $select->where(array('status != ?' => 13))
                        ->where(array('action' => $act))
                        ->order('id ASC');
                    }); 
            $results = array();
            foreach ($result as $row) {
                $results[] = $row;
            }
            return $results;

        }  
Run Code Online (Sandbox Code Playgroud)

当我尝试执行时,它会告诉我Notice: Undefined variable: act.我已经看到这个链接ZF2 tableGateway选择,但我想为这个功能设置参数.谢谢

php zend-framework2

1
推荐指数
1
解决办法
1832
查看次数

标签 统计

php ×2

codeigniter ×1

zend-framework2 ×1