草庐IT

codeigniter-helpers

全部标签

php - 在 codeigniter 中调试路由?

我想知道是否有任何简单的方法可以在codeigniter中调试路由?我希望能够在日志中看到以下内容:Clientsent:apps/somethingRoutefound:apps/(:any)-->applications/searchbyname/$1Redirecting:apps/something-->applications/searchbyname/something//andjustcausewecanletsmakethesearchbynamefunctionnotexistERROR-2012-09-1622:10:05-->404PageNotFound-->a

php - CodeIgniter 2.2.0 HMAC 不匹配错误

更新:即使下载了“已修复”的2.2.0,更新日志文件仍然充满:Session:HMACmismatch.Thesessioncookiedatadidnotmatchwhatwasexpected.从CodeIgniter2.1.3升级到2.2.0后出现错误:Session:HMACmismatch.Thesessioncookiedatadidnotmatchwhatwasexpected.Mcrypt扩展已启用。如果我设置$config['sess_encrypt_cookie']=FALSE;(不是生产选项)没有错误。非常感谢任何帮助。 最佳答案

php - 在 CodeIgniter 应用程序中实现服务层的正确方法

下面是在CodeIgniter应用程序中实现服务层的两种方式。第一种方法1.sendrequesttothecontroller2.callingservicelayermethodsfromcontroller3.returnprocessedresultdataset(D1)fromservicelayertocontroller4.thenaccordingtothatdatasetcontrollerdemanddatafrommodel5.modelreturndataset(D2)tothecontroller6.thencontrollersendseconddatase

php - Codeigniter 字符编码问题

我有几个没有数据库数据的简单页面,只是从Controller静态加载。我已将所有可能的设置为UTF-8编码。我检查了header,结果为UTF-8。但是,它仍然解析错误,显示这些字符:����。Controller:functionindex(){$this->load->view('french/header_view');$this->load->view('french/homepage_view');$this->load->view('french/footer_view');}配置文件:$config['charset']="UTF-8";标题View:....正文View

php - Codeigniter CSRF token 问题

我做了一个简单的注册/时事通讯网站,但我遇到了一个奇怪的问题。有些人得到一个错误,说AnErrorWasEncounteredTheactionyouhaverequestedisnotallowed.我已经尝试过谷歌,发现当CSRF设置为true时,人们遇到了同样的问题。然而,我并不是每个人都会遇到,只是一小部分人。我正在使用form_open和form_close,我可以看到隐藏字段(token)。我使用的是最新版本的Codeigniter2.0.2这是我的Controllerfunction__construct(){parent::__construct();session_s

php - Elasticsearch 和 Codeigniter (PHP)

我正在尝试将ElasticSearch与Codeigniter框架结合使用。我所做的只是安装ElasticSearch并将在网上找到的一个很好的PHP库复制(:P)到CI库:classElasticsearch{public$config_file='elasticsearch';public$index;function__construct($index=false){$CI=&get_instance();$CI->config->load($this->config_file);$this->server=$CI->config->item('es_server');}func

php - 应用程序的后端和前端 - Codeigniter

我需要问一个问题,如何将包含管理和前端部分的CI系统配置到单个CI安装中。提前致谢J 最佳答案 PhilSturgeon发布了实现这一目标的3种方法,并就每种方法的使用位置提出了建议。http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter 关于php-应用程序的后端和前端-Codeigniter,我们在StackOverflow上找到一个类似的问题: https

php - Codeigniter、timezone_menu 和 date_default_timezone_set

我使用Codeigniterstimezone_menu给出dropdownbox时区,我想知道我们应该如何通过PHPdate_default_timezone_set使用这些时区?codeigniters时区的一个例子是UP1。但是,您不能将其与PHPdate_default_timezone_set一起使用,因为它接收的字符串应该类似于Europe/Berlin问题是,有没有办法将codeigniter时区字符串转换为date_default_timezone_set可以接受的PHP时区字符串? 最佳答案 以下对我有用://Ex

php - 比较 CodeIgniter 与 Yii 的基准测试

我正在寻找最快的PHP框架。我找到了onebenchmark其中Yii比CodeIgniter快,并且anotherbenchmark其中CodeIgniter比Yii更快。那么,哪个更快? 最佳答案 虽然这并不直接适用于速度,但我们使用Yii构建了一个开源CRM应用程序(Zurmo.org)。在开始构建Zurmo之前,我们查看了Yii、Cakephp、Zend和Codeigniter。我们认为Yii是一个很棒的框架,因为它轻巧、快速且干净。它具有完整的功能集,并且与其他框架匹配得很好。我们对这个决定感到高兴。

php - CodeIgniter 在同一 Controller 中加载多个模型

这个问题不太可能帮助任何future的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visitthehelpcenter.关闭9年前。这是ControllerclassDashboardextendsCI_Controller{publicfunction__construct(){parent::__construct();$this->load->model("admin/post_model");$this->load->model("admin/comment_model");}