简体   繁体   English

如何在heroku codeigniter中部署?

[英]How deploy in heroku codeigniter?

I am trying to deploy my application in heroku with codeigniter, I have a series of errors that I have been solving, but I would like to know the correct way to configure the framework codeigniter to be able to deploy it in heroku, the database is configured and I have no problems with your connection. 我正在尝试使用codeigniter在heroku中部署我的应用程序,我已经解决了一系列错误,但是我想知道配置框架codeigniter使其能够在heroku中部署的正确方法,数据库是配置好了,您的连接没有问题。

At this point I have problems with loading the helper. 此时,我在加载助手时遇到了问题。

Problem 1: My helper located in the corresponding folder "helpers" and its name is cargarConsultas_helper: 问题1:我的助手位于相应的文件夹“ helpers”中,其名称为cargarConsultas_helper:

 <?php
if(!defined('BASEPATH')) exit('No direct script access allowed');

function getAreas()
{
    $ci =& get_instance();
    $query= $ci->db->get('areas');
    return $query->result();
}

?>

my controller in which I charge the helper: 我向助手收取费用的控制器:

 public function __construct()
    {
        parent::__construct();        
        $this->load->helper(array('url', 'cargarConsulta'));
 }

the error that throws me is: 引发我的错误是:

error 错误

I thank you for your help. 感谢您的帮助。

Try to rename your helper where the first letter only is upper case same applies for controllers and models and libraries etc 尝试重命名您的助手,其中首字母仅大写,适用于控制器,模型和库等

Filename Cargarconsultas_helper: 文件名Cargarconsultas_helper:

$this->load->helper(array('url', 'cargarconsulta'));

Class and filenaming guide 类和文件命名指南

https://www.codeigniter.com/user_guide/general/styleguide.html#file-naming https://www.codeigniter.com/user_guide/general/styleguide.html#file-naming

https://www.codeigniter.com/user_guide/general/helpers.html https://www.codeigniter.com/user_guide/general/helpers.html

替换$this->loaa->helper('cargarConsultas')错误是因为在filename cargarConsultas中, C是大写cargarConsultas ,在helper中,您写了c小,因此无法加载该文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM