codeigniter

Create custom driver using Codeigniter

旧街凉风 提交于 2021-02-10 15:13:05
问题 I'm trying to create my custom driver using Codeigniter Files structure: /libraries /Test_driver /drivers Test_driver_first_driver.php Test_driver.php Driver super class: class Test_driver extends CI_Driver_Library { function __construct() { $this->valid_drivers = array('test_driver_first_driver'); } } Driver Subclass : class Test_driver_first_driver extends CI_Driver { function index() { echo "Hello world!"; } } Testing code in welcome.php Controller : $this->load->driver('test_driver');

Force downloading file in php

家住魔仙堡 提交于 2021-02-10 14:44:57
问题 I have just finished my project and move to live server mean-while all contents and program are working very well on my Development section (XAMPP) and I have also moved this project to test on a live shared hosting server (Namecheap). all work good then until I purchase a VPS server and installed cpanel. When I uploaded my project and using php 7.3, things no longer are working right for file forcing download. Here is my code. //* Download item zip files public function downloadItemZipFiles(

Code Igniter url routing question (using trailing slashes)

与世无争的帅哥 提交于 2021-02-10 14:40:14
问题 I am brand new to codeIgniter. I am very particular about urls on the sites that I develop. Is it possible to create these sorts of urls? Generally sites I develop have an integrated admin interface as well with new, edit or delete added onto the end of the url following a slash. Here are some hypothetical examples (one with an admin url): top level pages (no trailing slash) site.com/about site.com/contact site.com/contact/edit section index lists (lists have trailing slash) site.com/blog/

Code Igniter url routing question (using trailing slashes)

≯℡__Kan透↙ 提交于 2021-02-10 14:38:48
问题 I am brand new to codeIgniter. I am very particular about urls on the sites that I develop. Is it possible to create these sorts of urls? Generally sites I develop have an integrated admin interface as well with new, edit or delete added onto the end of the url following a slash. Here are some hypothetical examples (one with an admin url): top level pages (no trailing slash) site.com/about site.com/contact site.com/contact/edit section index lists (lists have trailing slash) site.com/blog/

Force downloading file in php

倖福魔咒の 提交于 2021-02-10 14:37:14
问题 I have just finished my project and move to live server mean-while all contents and program are working very well on my Development section (XAMPP) and I have also moved this project to test on a live shared hosting server (Namecheap). all work good then until I purchase a VPS server and installed cpanel. When I uploaded my project and using php 7.3, things no longer are working right for file forcing download. Here is my code. //* Download item zip files public function downloadItemZipFiles(

How to pass a filename via URL?

不打扰是莪最后的温柔 提交于 2021-02-10 14:26:50
问题 I need to pass filenames via the url, e.g.: http://example.com/images/niceplace.jpg The problem I'm having is when the file name contains a blank character, e.g.: http://example.com/images/nice place.jpg or http://example.com/images/nice%20place.jpg For these two URLs, codeigniter complains about the blank char: "The URI you submitted has disallowed characters." How should I go about fixing this? I know I can add the blank character to the permitted_uri_chars in config.php but I'm looking for

Codeigniter Validation error: “Unable to access an error message corresponding to your field name Captcha. (recaptcha)”

纵然是瞬间 提交于 2021-02-10 05:43:07
问题 I'm trying to add Google's reCAPTCHA into my Codeigniter web app. But I keep running into this problem: Unable to access an error message corresponding to your field name Captcha. (recaptcha) I try submitting the form to throw an error, $server_output['success'] should be FALSE thus executing $this->form_validation->set_message('recaptcha', 'Please redo the {field}.'); but Codeigniter doesn't seem to be running the callback function at all... The Validation is working for everything else as

Forcing CodeIgniter to send view and stop working

被刻印的时光 ゝ 提交于 2021-02-09 08:21:49
问题 Hello I'm using inherited controllers. These are my controllers: -baseAdminController: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class _BaseAdminController extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('session'); $calledFunction= $this->router->fetch_method(); if ($calledFunction!= 'loginView' && $calledFunction!= 'doLogin') { $this->checkSession(); } } public function checkSession() { if ($this->session-

Forcing CodeIgniter to send view and stop working

。_饼干妹妹 提交于 2021-02-09 08:20:28
问题 Hello I'm using inherited controllers. These are my controllers: -baseAdminController: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class _BaseAdminController extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('session'); $calledFunction= $this->router->fetch_method(); if ($calledFunction!= 'loginView' && $calledFunction!= 'doLogin') { $this->checkSession(); } } public function checkSession() { if ($this->session-

Forcing CodeIgniter to send view and stop working

房东的猫 提交于 2021-02-09 08:20:28
问题 Hello I'm using inherited controllers. These are my controllers: -baseAdminController: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class _BaseAdminController extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('session'); $calledFunction= $this->router->fetch_method(); if ($calledFunction!= 'loginView' && $calledFunction!= 'doLogin') { $this->checkSession(); } } public function checkSession() { if ($this->session-