无法加载请求的文件:helpers / common_help_helper.php

时间:2019-04-23 14:54:42

标签: codeigniter

它似乎无法加载我在helper文件夹中创建的通用帮助器 为我的codeigniter项目加载命令。

enter code here


<?php 
 function public_url($url){

    return base_url('public/'.$url)
 }

1 个答案:

答案 0 :(得分:0)

You are calling another helper that is being used in your helper. So you need to load the url helper in your controller before you load yours.

i.e.

$this->load->helper('url');         // Core URL helper for base_url()
$this->load->helper('common_help'); // This is your common_help_helper.php

And you have a missing ; in your function

function public_url($url) {
    return base_url('public/' . $url); // <<< Missing ; in your code
}