我需要以不同的方式循环许多数组并将其显示在页面中.数组由模块类生成.我知道最好不要在'views'上包含函数,我想知道在哪里插入函数文件.
我知道我可以"扩展"帮助者,但我不想扩展帮助者.我想用循环函数创建一个帮助器.让我们称之为loops_helper.php
我已经设置了我的控制器和我的联系表单.但是当我点击我的联系页面上的"提交"时,我没有收到任何错误,但是我没有收到任何电子邮件.任何人都可以帮我弄清楚为什么我实际上没有收到电子邮件?我感谢任何帮助.这是我的控制器代码:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
public function index()
{
$this->template->build('home');
}
public function email() {
$name = $this->input->post('name');
$email = $this->input->post('email');
$phone_number = $this->input->post('phone_number');
$message = $this->input->post('message');
$this->load->library('email');
$this->email->from($email, 'Your Name');
$this->email->to('anish@develop.io');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message(
'My name is'.$name.', Im testing this email class. My email is '.$email. '. My Phone number is '.$phone_number.
' This is my message '.$message. ' Thanks!!'
);
$this->email->send();
echo $this->email->print_debugger();
$this->template->build('home');
} …Run Code Online (Sandbox Code Playgroud)