【问题标题】:Unable to locate the specified class: Session.php in CI找不到指定的类:CI 中的 Session.php
【发布时间】:2018-01-27 13:43:57
【问题描述】:

我正在尝试从另一个控制器调用函数。

$this->load->library('../controllers/Sondage');
$data11 = $this->Sondage->resultats($evaluation_id,1);

这会导致以下错误:

Unable to locate the specified class: Session.php

如何从另一个控制器调用这个函数?

【问题讨论】:

  • 您好,欢迎来到 StackOverflow。你的问题很不清楚,不太可能得到正确的答案。花一分钟阅读how-to-ask 部分并编辑您的帖子。特别要阅读this 并尝试创建一个“最小、完整且可验证的示例”。
  • 你不能在普通的codeigniter的控制器中加载控制器,你应该使用第三方扩展HMVC

标签: php codeigniter session


【解决方案1】:

控制器是否在同一目录中?如果在同一个目录,你可以试试:

require_once('sondage.php');
$sondage = new sondage();
$data11 = $sondage->resultats($evaluation_id,1);

【讨论】:

  • 谢谢你的回答,我已经试过了,但还是有问题
猜你喜欢
  • 1970-01-01
  • 2017-06-21
  • 2015-07-02
  • 2019-10-23
  • 2018-07-28
  • 2018-04-23
  • 1970-01-01
  • 1970-01-01
  • 2021-02-28
相关资源
最近更新 更多