codeigniter

CodeIgniter Paging 404

落花浮王杯 提交于 2019-12-23 03:32:00
问题 I've checked several threads on here regarding paging in CodeIgniter but I haven't found a solution to my problem. I have a controller class located at controllers/admin/index.php called 'Index' that contains the following code: class Index extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper("url"); $this->load->helper( 'events_helper' ); $this->load->helper( 'delegates_helper' ); $this->load->model( 'admin/event_model' ); $this->load->model(

cron job return login page html in codeigniter

一世执手 提交于 2019-12-23 03:31:49
问题 In my application i need to set cron job for daily updation. I am using CodeIgniter 3.0 My config.php file $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO'; Here is my controller class Cron extends CI_Controller { public function cron_job(){ if (!$this->input->is_cli_request()){ echo 'test'; //show_error('Direct access is not allowed'); } else{ echo 'call'; } } } and i have set path in cpenal like /usr/bin/php /home/public_html/my_app/index.php cron cron_job But this return html

CodeIgniter + Google Maps API V3 + close InfoWindow()

六月ゝ 毕业季﹏ 提交于 2019-12-23 03:25:30
问题 Anyone have an idea how to make the CodeIgniter Google Maps API v3 library only allow a single info window to be open, and also to make it hide thei nfo window when clicking outside of the info window. Library: http://www.in-the-attic.co.uk/2010/08/03/google-map-library-for-codeigniter-example-usage-update/ 回答1: If you want only one info window to display at a time (as this is the behavior of Google Maps), you should create only one instance info window. Hope it helps 回答2: I ended up using a

using smarty with codeigniter

亡梦爱人 提交于 2019-12-23 03:19:04
问题 I wants to use codeigniter and smarty together.i.e. I wants to use html files instead of .tpl.php files of codeigniter as of smarty. Is this possible or how can I do this.I have searched a lot and find some examples but none of some works as required by me. 回答1: You should create a library Smarty_tpl.php : <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); //smarty class require BASEPATH . "../../smarty/libs/Smarty.class.php"; class Smarty_tpl extends Smarty { function _

Integrating Codeigniter 2 with phpspec2

江枫思渺然 提交于 2019-12-23 03:14:11
问题 I want to integrate phpspec2 with CodeIgniter 2. I've succesfully installed phpspec using composer as described on phpspec website. Now I'd like to integrate it into my CodeIgniter 2 installation. I've found an article by AniDear on this subject and did everything as described. However when I run bin/phpspec I get an error: PHP Warning: require(core/Common.php): failed to open stream: No such file or directory in C:\xampp\htdocs\eljotengine\spec\ci_bootstrap.php on line 37 Warning: require

How to Disable Copy/Paste in tinymce

两盒软妹~` 提交于 2019-12-23 03:13:07
问题 i'm using tinymce RTF editor on my website. i want to disable copy/paste option in tinymce textarea. i found this method on stackoverflow but it didn't work for me. How to Prevent/disable copy and paste in Tinymce document.addEventListener('paste', function(e){ e.preventDefault(); }); 回答1: You should be able to use paste_preprocess if you include the paste plugin. If you're using paste_preprocess , make sure you're passing it as an option to tinymce.init() , and also including the plugin. For

CodeIgniter Ajax response contains data but output is undefined

三世轮回 提交于 2019-12-23 03:09:31
问题 I have been working on a CodeIgniter project and hav run into an issue with using ajax to return the data from my controller. Controller: function outputAjax() { $this->load->model('my_model'); $data['results'] = $this->site_model->getInfo(); $this->output->set_output(json_encode($data)); } Model: function getInfo() { $this->db->order_by('PubDate','DESC'); $query = $this->db->get('Articles', 50); return $query->result(); } Ajax function in View: <div id="article-area"> <p>Hey this is where

SMTP not working in CI 3.0 while same code is working in CI 2.*

你说的曾经没有我的故事 提交于 2019-12-23 03:00:36
问题 This is a big issue i'm struggling with, the thing is our application needs to send email, now we are relying on smtp, until 2.*(latest) email worked fine, but as soon as we ported app in ci 3.0 everything worked by smtp, here is error we are getting on ci 3.0 sample email A PHP Error was encountered Severity: Warning Message: fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:140D00CF:SSL routines:SSL_write:protocol is shutdown Filename: libraries/Email.php Line Number

codeigniter and ajax contact form

ぐ巨炮叔叔 提交于 2019-12-23 02:55:21
问题 I'm trying to use ajax within my contact form in a codeigniter app. I have it to where the ajax call is made, but no post data is being sent to the server. I can't figure out why. Please help. I do have some returns in there, but they do nothing. Also, $this->input->post('name') is null. Form view <?php echo form_open('welcome/submit_contact'); echo form_error('name'); echo form_label('Name', 'name'"'); echo form_input('name', set_value('name'), 'id="name); echo form_error('email'); echo form

Complex codeigniter user search query

早过忘川 提交于 2019-12-23 02:48:28
问题 I have 3 tables user, profile and location. The structure of these tables are: user table user_id | email | pass | activated | banned profile table user_id | name | birthday | picture | gender | last_active location table user_id | city | country | latitude | longitude Now here are search conditions: User must be activated(1) to appear in search result. User must not be banned(0). Search results must be nearby location according to latitude and longitude. search result must order by last