codeigniter

Alto Router not working for controllers

陌路散爱 提交于 2020-01-15 10:15:28
问题 I am trying pass controller name and method to Alto Router map method but it doesnt work in index.php i have following code <?php require_once 'vendor/autoload.php'; use Route\AltoRouter; use App\Controllers\HomeController; $router = new AltoRouter(); $router->setBasePath('demo/'); $router->map('GET','/', 'HomeController#index'); $router->map('GET', '/php', function(){ echo 'It is working'; }); $match = $router->match(); // call closure or throw 404 status if( $match && is_callable( $match[

Alto Router not working for controllers

。_饼干妹妹 提交于 2020-01-15 10:15:03
问题 I am trying pass controller name and method to Alto Router map method but it doesnt work in index.php i have following code <?php require_once 'vendor/autoload.php'; use Route\AltoRouter; use App\Controllers\HomeController; $router = new AltoRouter(); $router->setBasePath('demo/'); $router->map('GET','/', 'HomeController#index'); $router->map('GET', '/php', function(){ echo 'It is working'; }); $match = $router->match(); // call closure or throw 404 status if( $match && is_callable( $match[

Call to a member function result() using CodeIgniter

安稳与你 提交于 2020-01-15 09:54:15
问题 I am having a strange issue with mysql and codeigniter. I am getting the following error message: Fatal error: Call to a member function result() on a non-object in Controller: class Event extends Client_Controller { function __construct() { parent::__construct(); $this->load->model('Event_Model', '', TRUE); } function pending() { $data['query'] = $this->Event_Model->get_events_list("pending"); $this->load->view('event/pending', $data); } } Model: class Event_Model extends Client_Model {

Time difference between a Date and current Time?

北城余情 提交于 2020-01-15 09:05:10
问题 Assume I have a funny video site that shows funny videos to users. Below every video, I want to have a statement that says "5 seconds ago", "31 minutes ago", "Yesterday", "2 days ago" based on a timestamp of the video and the current time. The timestamp that I have is in the format: 2011-10-17 07:08:00 . I'm not too good with dates, but I'm guessing that I need to find the difference between the 2 date/time in seconds, then decide if its between 0sec & 60sec to display in seconds, or between

How to get server time not localtime in php

大兔子大兔子 提交于 2020-01-15 07:26:08
问题 First Part of the Question : When I m using new Date (); in Javascript. it gives Fri Jun 19 2015 11:18:02 GMT+0530 (India Standard Time) This is giving my local machine time.whereas server time is 7 mins ahead. Is there any function which gives server time not local machine time same exactly as new Date() But from server not localMachine. In My project i am using codeigniter.is there any method to keep datetime same as servertime not localmachine time. so when i use echo date('Y-m-d H:i:s') .

Call to a member function get() on null error

自作多情 提交于 2020-01-15 07:09:44
问题 I keep getting this error in CodeIgniter-2.2.1.(Fatal error: Call to a member function get() on null in C:\xampp\htdocs\ci\application\models\site_model.php on line 6) I am not sure why this is happening. Am I calling the function correctly? Line 6 is $this->load->model('site_model'); controller site.php <?php class Site extends CI_Controller{ function index(){ $this->load->model('site_model'); $data['records'] = $this->site_model->getAll(); $this->load->view('home', $data); }} site_model.php

Call to a member function get() on null error

孤者浪人 提交于 2020-01-15 07:09:13
问题 I keep getting this error in CodeIgniter-2.2.1.(Fatal error: Call to a member function get() on null in C:\xampp\htdocs\ci\application\models\site_model.php on line 6) I am not sure why this is happening. Am I calling the function correctly? Line 6 is $this->load->model('site_model'); controller site.php <?php class Site extends CI_Controller{ function index(){ $this->load->model('site_model'); $data['records'] = $this->site_model->getAll(); $this->load->view('home', $data); }} site_model.php

Call to a member function get() on null error

谁说我不能喝 提交于 2020-01-15 07:09:09
问题 I keep getting this error in CodeIgniter-2.2.1.(Fatal error: Call to a member function get() on null in C:\xampp\htdocs\ci\application\models\site_model.php on line 6) I am not sure why this is happening. Am I calling the function correctly? Line 6 is $this->load->model('site_model'); controller site.php <?php class Site extends CI_Controller{ function index(){ $this->load->model('site_model'); $data['records'] = $this->site_model->getAll(); $this->load->view('home', $data); }} site_model.php

Fatal error HelperSet not found when setting up Doctrine Console (with CodeIgniter)

混江龙づ霸主 提交于 2020-01-15 07:07:21
问题 I've got a problem setting up Doctrine with CodeIgniter. When running the following error is coming up: Fatal error: Class 'Symfony\Component\Console\Helper\HelperSet' not found in /Applications/MAMP/htdocs/CodeIgniter-2.2.1/application/doctrine.php on line 21 The folder structure looks like this /application/ /application/doctrine.php /application/libraries/ /application/libraries/Doctrine/ /application/libraries/Doctrine/Common /application/libraries/Doctrine/DBAL /application/libraries

Fatal error HelperSet not found when setting up Doctrine Console (with CodeIgniter)

谁说我不能喝 提交于 2020-01-15 07:06:53
问题 I've got a problem setting up Doctrine with CodeIgniter. When running the following error is coming up: Fatal error: Class 'Symfony\Component\Console\Helper\HelperSet' not found in /Applications/MAMP/htdocs/CodeIgniter-2.2.1/application/doctrine.php on line 21 The folder structure looks like this /application/ /application/doctrine.php /application/libraries/ /application/libraries/Doctrine/ /application/libraries/Doctrine/Common /application/libraries/Doctrine/DBAL /application/libraries