草庐IT

codeigniter-routing

全部标签

php - CodeIgniter &get_instance() 在 php5.6 版本中不工作?

我的codeigniter网站在php5.4版本中运行正常,但是当我将我的php版本升级到php5.6.30时,它无法正常工作。function&get_instance(){returnCI_Controller::get_instance();}以上函数位于我文件的第233行,它返回空值。错误-fatalerror:在第233行的Coginiter_site\system\core\CodeIgniter.php中找不到类“CI_Controller”我已经追踪到错误点-system/core/common.php下的代码if(!function_exists('load_clas

php - CodeIgniter - 如何删除 url 路由中的类名

我有http://localhost/CIrbbps/index.php/class_name/method_name.如何删除类名?,这样我就可以得到http://localhost/CIrbbps/index.php/method_name.谢谢 最佳答案 为了将www.domain.com/services映射到pages/services,您需要:$route['services']='pages/services'如果你想将www.domain.com/whatever映射到pages/whatever以及任何有一些变体并

php - Codeigniter 3 - 如何从 URL 中删除函数名称

我的网址是:example.com/controller/function/parameter=>example.com/category/index/category_name我需要:example.com/category/category_name我已经尝试了Stackoverflow提供的几种解决方案,但都没有用。它要么重定向到主页,要么返回404页面未找到。我尝试过的选项是:$route['category']="category/index";//1$route['category/(:any)']="category/index";//2$route['category/

php - 调用未定义的方法 Illuminate\Notifications\Channels\MailChannel::route()

我正在尝试向特定邮件ID发送通知,并在我的Controller中使用以下代码:$product=Product::first();Notification::route('mail','suraj@yahoo.com')->notify(newNewProducts($product));但是我得到一个错误调用未定义的方法Illuminate\Notifications\Channels\MailChannel::route()。所有的先决条件都被添加了,当我使用我的用户模型的一个对象时,我什至成功地发送了一封邮件。我在laraveldoc5.3中遇到了这个过程。

php - 首次在 Codeigniter 3 框架中不登录帐户

我有一个网站和登录系统。在localhost中,一切都很完美。但是,在服务器(HOSTGATOR)中,当人们想要登录他们的帐户时,他们输入登录密码并点击“登录”按钮,它会刷新页面但不会登录。他们应该输入2-3次然后系统登录in.哪里会出问题?publicfunction__construct(){parent::__construct();$this->load->helper(array('form','url','security'));$this->load->library(array('session','form_validation','email'));$this->l

php - Codeigniter 函数 "from_label()"给出错误

我给你们发了一张错误的截图,表单工作正常唯一的问题是在“from_label()”如果我评论它输入字段工作正常没有任何错误'login_form','class'=>'form_horizontal');?> 最佳答案 改变^^^^到引用form_label([$label_text=''[,$id=''[,$attributes=array()]]])form_input([$data=''[,$value=''[,$extra='']]])仅供引用:form_label()需要第一个参数才能顺利运行。echoform_label

php - 在 Codeigniter-HMVC 项目中以标准方式管理 URL

我在codeigniter-HMVC中开发了项目,现在我想以标准方式管理url。我当前的网址:http://xyz/home/contactushttp://xyz/home/aboutus........我想要的就像:http://xyz/contactushttp://xyz/aboutus........我正在使用HMVCcodeigniter结构。 最佳答案 您可以在routes.php中定义自定义路由$route['contact-us']="home/home/contactus";^^^^NewURLmoduleCon

php - 我已经使用 laravel passport 创建了 API 身份验证。当授权 token 出错时,它会向我发送错误 "Route [login] not defined"

我已经使用laravelpassport创建了API身份验证。当授权token出错时,它会向我发送错误“Route[login]notdefined”,尽管我需要JSON响应,如“unauthorized401”这是api.php这里users/authenticate是一个登录路由,但是当我使用auth:api中的其他路由时中间件。如果token是错误的,它会向我发送一个错误“Route[login]notdefined”,但我不需要这个错误。我需要像{error:unauthorized,code:401}这样的JSON错误。'Auth\LoginController@login'

php - Docker CodeIgniter 2.2.6 文件上传不工作

我正在尝试在Windows10上使用带有Docker的LAMP堆栈设置运行CodeIgniter2.2.6应用程序。应用程序已启动并正在运行,甚至数据库连接(使用mariadb)工作正常。但是,当我开始创建文件上传功能时,它失败了。浏览器显示“172.18.0.3响应时间过长。”这是我的docker-compose.yml文件:-version:'3'services:php-apache:build:context:./docker/php-apacheports:-8081:80volumes:-./app:/var/www/htmllinks:-'mariadb'mariadb:

php - 无法在 codeigniter 中按类别过滤数据

这个问题在这里已经有了答案:Whatisthedifferencebetweensingle-quotedanddouble-quotedstringsinPHP?(7个答案)关闭3年前。使用URL进行php数据过滤我正在开发一个在线商店,我想在其中显示类别明智的数据。但我不能!我的代码或URL有什么问题吗?我像下面这样传递URLhttp://localhost/e-bookshop/users/all_books?ctg=1我的模型:publicfunctionget_books(){$this->db->select('*');$this->db->from('category')