- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经敲了 5 个小时的头,终于解决了问题,但我就是在不知道原因的情况下无法休眠。让我先解释一下这个问题。
我使用了 codeigniter HMVC 扩展并将 ion_auth 作为单独的模块安装。
|-modules
|--auth
|---config
|-----ion_auth.php
|---controllers
|-----auth.php
|---models
|-----ion_auth_model.php
|---views
config/ion_auth.php
中的项目未加载到
ion_auth_model.php
文件。
ERROR - 2016-02-24 20:09:26 --> Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as
id
, .name
, .description
JOIN ON .=.id
WHERE . = '2'' at line 1 - Invalid query: SELECT . asid
, .name
, .description
JOIN ON .=.id
WHERE . = '2'
'ion_auth'
从
ion_auth_model.php
中的几个方法调用一切都开始起作用了。
$this->tables = $this->config->item('tables', 'ion_auth');
$this->join = $this->config->item('join', 'ion_auth);
$this->tables = $this->config->item('tables');
$this->join = $this->config->item('join');
最佳答案
这是文件 system\core\Config.php 中 CodeIgniter 函数 config->item() 的内部实现
/**
* Fetch a config file item
*
* @param string $item Config item name
* @param string $index Index name
* @return string|null The configuration item or NULL if the item doesn't exist
*/
public function item($item, $index = '')
{
if ($index == '')
{
return isset($this->config[$item]) ? $this->config[$item] : NULL;
}
return isset($this->config[$index], $this->config[$index][$item]) ? $this->config[$index][$item] : NULL;
}
$index
参数,该函数检查两个参数是否在配置中初始化并返回
config[$index]
CI实例的;或
null
如果其中任何一个未初始化。
config[$item]
未在 CI 实例中设置,该函数始终返回
null
.假设情况并非如此,因为避免
$index
时您的通话不会崩溃。 .
$index
作为第二个参数,您的代码会因为函数返回
null
而崩溃,这意味着
config[$index]
未设置 CI 实例。现在的问题是为什么它没有设置,我在这里帮不了你,但看起来你缺少加载一些模块。
关于Codeigniter HMVC + ion_auth 无法加载配置项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35608344/
如何检查用户是否登录在 View 中?? 类似这样的: if ($this->ion_auth->logged_in()) { // do something .. } else {
我已经敲了 5 个小时的头,终于解决了问题,但我就是在不知道原因的情况下无法休眠。让我先解释一下这个问题。 我使用了 codeigniter HMVC 扩展并将 ion_auth 作为单独的模块安装。
我正在为我的应用程序使用 codeigniter 和 Ion_auth。安装了它们,它们工作得很好......这是我第一次真正不得不进入并使用 codeigniter 进行自定义重定向(codeign
我现在正在使用ion_auth,在 ion_auth 中,我们可以像这样选择所有记录: Controller public function index($group_id = NULL) {
所以我要转移到新的主机服务器。我在旧服务器上使用的一个学校项目必须保持正常运行,不得停机,因此我正在准备新服务器并移动所有关联的文件。我已将虚拟主机设置完毕并正常工作,但现在 CodeIgniter
我是一名优秀的程序员,十分优秀!