codeigniter

How to make textArea handle multiple events the same?

梦想的初衷 提交于 2019-12-25 04:27:12
问题 I want to make my text area handle onCut , onPaste , onKeydown and onKeyup the same. I.e. they all affect the textArea the same. I am creating the javascript as a string and using it within Codeigniter . Currently, in my code below, none of the functions are working when all together, How can I fix this? Note: when the code is only: $javascript= 'onKeyDown || onKeyUp="exampleFunction()"'; It works fine, but doesn't work with: $javascript= 'onKeyDown || onKeyUp || onPaste || onCut=

passing parameter from view to library and return after process Code igniter

白昼怎懂夜的黑 提交于 2019-12-25 04:23:10
问题 I am going to built the custom library. I want to pass string from view to library and process and then return to same view after. My code looks like: application/libraries/MultiImageParser.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); //return profile pic of img arrays. class MultiImageParser { function parser($multiImage) { //get $prods->images here as parameter $images = $multiImage; //gets multiple image from controller like 1.jpg,2.jpg,3.jpg $pieces =

Codeigniter: Extend Custom library from core folder in a libary class

纵然是瞬间 提交于 2019-12-25 04:22:59
问题 I have made a core library in application/core folder called MY_Library and I am trying to extend it from library class in application/libraries but unfortunately it cant find the file. //application/core/My_Library.php class My_Library{ function __construct(){ } /** * This is the generic function that calls php curl to make a query. * @param $url * @param array $data * @param string $type * @return mixed|string */ public function callService($url,$data=array(),$type="get"){ if (strtolower(

codeigniter $this->dbutil->csv_from_result ignore last delimiter

冷暖自知 提交于 2019-12-25 04:22:40
问题 I am using the following function to export to CSV. $this->dbutil->csv_from_result() Unfortunately at the end of the line it prints delimiter, When I use CSV to import data again it takes it as a field with out key. example are here: "id", "time", "name", "1", "1400000000", "John", "2", "1400000000", "Matt", Wondering if anybody can help with this. 回答1: You can simply use rtrim($string, ","); // this will strip the comma from the end of the string Example : $string = "abc" ; echo rtrim(

Codeigniter - How to route controller based on whether a subdomain exists or not

一笑奈何 提交于 2019-12-25 04:18:01
问题 I'm creating a SaaS web app in codeigniter and i'm trying to determine how to route to a specific controller based on whether a subdomain exists or not. Currently I have it so if you put a url of subdomain.example.com , my default controller checks whether the subdomain in the url exists in the database, and if it does not, it displays the error page. public function __construct() { parent::__construct(); $subdomain_arr = explode('.', $_SERVER['HTTP_HOST'], 2); //creates the various parts

How to multi-thread using codeigniter famework(PHP)?

南楼画角 提交于 2019-12-25 04:16:01
问题 I am using codeigniter framework. And i am searching for a best practice to multi-thread using MVC framework of codeigniter. I am thinking of creating a class in which all the functions will be written to run in a different independent thread. Please suggest me techniques to multi thread using codeigniter's MVC framework. 回答1: You can't do multi-threading directly with PHP. Every page load is handled by a single thread. If you want the value of function foo() to be passed to function bar()

codeigniter error with selecting data from table

痞子三分冷 提交于 2019-12-25 04:09:29
问题 I cant figure out whats wrong with my model, it said a Fatal Error occured. Here's my model file: function getName($no_ktp){ $this->db->select('nama')->from('dt_prbd')->where('no_ktp', $no_ktp); $qry_getName = $this->db->get(); if ($qry_getName->num_rows() > 0) { foreach ($qry_getName->result() as $data_getName){ $hasil_qry_getName[] = $data_getName; } return $hasil_qry_getName; } } I got this error. Fatal error: Call to a member function num_rows() on boolean in C:\xampp\[APP_PATH]\M_hrd

Codeigniter-HMVC get_instance() in library does not return expected result

隐身守侯 提交于 2019-12-25 04:08:52
问题 I have the Controller: application/controllers/bob.php Then in a library I use in the controller Bob.php, I have this code: $CI =& get_instance(); echo get_class($CI); So I open the url "domain.com/bob", and I get the correct echo when HMVC is not installed, which is Bob As soon as I install HMVC, the result is: CI So basically, this means I cannot use $CI->someVariableINeed that was declared in Bob because it doesn't exists in CI. Note that $CI->load->helper(), $CI->load->view(), .. are all

Codeigniter select- from- where

十年热恋 提交于 2019-12-25 03:59:13
问题 Just want to make codeigniter filter form work. For example, if "Samsung" will be selected from dropdown list and "2G" from checkbox fields, rows with id 1 and 4 should be returned. But my model returns nothing.I think the problem is in IF statement of the model but I cannot find out what is the exact reason. Please help me. Here is my database table: Here is my filter form: Here is My Model: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Model_example

403 error when moving CodeIgniter app from localhost to QA server

女生的网名这么多〃 提交于 2019-12-25 03:54:29
问题 I’ve looked in the forums (both here and on CodeIgniter.com) but haven’t found any answers that help. I have a CI 2.0.2 app that I developed locally in MAMP. It works perfectly. I copied the entire CI install up to our QA server, and am getting 403 Forbidden errors on every single page (even the default.) The file permissions are the same as all our other (non-CI) apps on that server. We don’t have a .htaccess file on the server anywhere, aside from the ones in the CI install. I’ve renamed