php - Codeigniter - 无法调用系统的 lang() 函数

标签 php codeigniter

尝试调用作为 codeigniter 的系统/助手 (language_helper.php) 一部分的 lang() 函数,导致 fatal error

Fatal error: Call to undefined function lang()

$def_actions['add'] = array('name' => lang('carbogrid_add'), 'alias' => 'add', 'url' => $this->add, 'icon' => 'ui-icon-circle-plus', 'toolbar' => TRUE, 'grid' => FALSE);

最佳答案

你必须在这样做之前加载助手:

$this->load->helper('language');

$def_actions['add'] = array('name' => lang('carbogrid_add'), 'alias' => 'add', 'url' => $this->add, 'icon' => 'ui-icon-circle-plus', 'toolbar' => TRUE, 'grid' => FALSE);

关于php - Codeigniter - 无法调用系统的 lang() 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5716050/

相关文章:

不存在可见问题时的 CodeIgniter 404 错误日志

apache - 如何停止 .htaccess 指令而不重写循环

php - Codeigniter 组合的 AND OR 条件不起作用

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP

php - 网站 Cookie - 是否存在任何安全问题?

php - 1and1 服务器中的 Laravel Artisan PHP 版本错误

php - 检索维基百科文章的第一段

php - 如何回显此 MySQL 查询的结果?

php - 重启浏览器后 Cookie 被删除

php - 使用 CodeIgniter,如何查明一条记录是否已存在于数据库中?