为什么我会"调用未定义的函数get_filenames()"?

She*_*don 0 php codeigniter

我正在尝试使用url帮助程序获取文件名列表,但是我收到以下错误:

调用未定义的函数get_filenames()

我自动加载了url帮助器,然后在Controller中显式加载它,我仍然得到错误.为什么我收到此错误?

控制器:

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

class Downloads extends CI_Controller {

    public function index()
    {   
        $this->load->helper("url");
        $this->template->write_view('content', 'download_view');
        $this->template->render();
    }
}
Run Code Online (Sandbox Code Playgroud)

视图:

<? get_filenames("/somefolder"); ?>
Run Code Online (Sandbox Code Playgroud)

Sho*_*hoe 7

你已经加载了不包含任何类似的url helperget_filenames().也许你的意思是加载文件助手:

$this->load->helper('file');
Run Code Online (Sandbox Code Playgroud)