codeigniter-2

How can I get CodeIgniter 2.1.4 to load my extended Controller Class?

你离开我真会死。 提交于 2019-12-25 02:33:06
问题 I have looked for this answer all through stackoverflow and none have been able to help me. my file name is: application/core/MY_Controller.php class MY_Controller extends CI_Controller { /** * Constructor */ public function __construct() { parent::__construct(); } } I made a post in this thread asking if anyone had found an answer. I tried everything in that thread, and in all suggested links. I'm at a complete loss. Everything works on my local WAMP server (apache 2.4 php 5.4) and not on

Couldn`t connect to helper in Codeigniter

吃可爱长大的小学妹 提交于 2019-12-25 00:40:27
问题 Trying add default helper in Codeigniter, type in autoload $autoload['helper'] = array('url'); But i have an error Unable to load the requested file: helpers/_helper.php on my system/helpers folder there is no such file like _helper.php what i shoul do to load it? 回答1: Check whether you have an empty array set to $autoload['helper'] variable in application/config/autoload.php. $autoload['helper'] = array(''); // throw an error stated Replace it with $autoload['helper'] = array(); Even though

image cropping with codeigniter no GD library - GD2 is intalled

醉酒当歌 提交于 2019-12-24 23:27:53
问题 I am working on media library for a website at the moment, and one of the features is that user can create a cropped version of an image that they upload. My problem however is this, when I try and crop the image, I get the following error, The path to the image is not correct. Here is my code, $config['image_library'] = 'gd2'; $config['source_image'] = "/media/images/products/".$this->data['image']; //die($config['source_image']); $config['maintain_ratio'] = FALSE; $config['x_axis'] = $this-

pass variable from javascript function to controller method in codeigniter

做~自己de王妃 提交于 2019-12-24 18:53:26
问题 I'm new in CodeIgniter. I am making a project in which I make a javascript function in view an in this I define a variable .. it looks like this var $rowCount=0; function invest() { $rowCount=$('#ulinvestment').find('.rowInvestment').length; } my controller function contains function input(parameter //i want to pass $rowcount value here ){ $this->load->helper('form'); $this->load->helper('html'); $this->load->model('mod_user'); $this->mod_user->insertdata(); } I want to access the variable

Codeigniter duplicate elements from the database

痞子三分冷 提交于 2019-12-24 17:27:17
问题 I've got a page that contains 4 products loaded from the database, when you scroll down you get 4 more products every time. This products are loaded in a random way, the problem are the duplicate products. This is the line that I used into the model: $this->db->order_by('productID', 'RANDOM'); Without this line everything works fine. I can't use limit set to 1 because I've got: $query = $this->db->get('product', 4, $offset); There's a simple way to solve this problem? I've to do an array that

Codeigniter cannot refresh page after session destroy and direct

≡放荡痞女 提交于 2019-12-24 15:11:40
问题 I have a PHP program written on code igniter that needs your help! Have been trying for 3 weeks! I have the htaccess mod rewrite to make http://www.sampleurl.com/controllername instead of http://www.sampleurl.com/index.php/controllername <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to

Datatables TableTools - Not able to find the path for sSwfPath

孤街浪徒 提交于 2019-12-24 12:39:27
问题 I am using codeigniter framework to build my web application. I need to export my table from datatables to csv and excel. But I am getting an error while loading the sSwfPath in the datatables TableTools : I have included the following libraries : <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://localhost/codegen/assets/js/jquery.dataTables.js" type="text/javascript"></script> <script src="http://localhost/codegen/js/jquery.dataTables

Getting broken images from blob storage in Azure websites

泄露秘密 提交于 2019-12-24 12:35:10
问题 My php code seems correct, (the part that talks to blob storage). //talk to blob storage, get links, based on file name $storageClient = $this->azure->get_blob_storage(); foreach($result as $photo) { $sharedAccessUrl[] = $storageClient->generateSharedAccessUrl( 'container', $photo['File'], 'b', 'r', $storageClient ->isoDate(time()), $storageClient ->isoDate(time() + 3000) ); } foreach($sharedAccessUrl as $item) { $pictures[] = $item; } This gets all the absolute url links, I then store it

Joining tables in different databases with the CI DataMapper ORM

喜欢而已 提交于 2019-12-24 12:13:57
问题 I did search for a solution, but found nothing helpfull. This question was about using multiple databases with datamapper but I already use that method. user model: class User extends DataMapper { var $prefix = "app_"; var $db_params = 'default'; ... company model: class Company extends DataMapper { var $prefix = "tbl_"; var $db_params = 'super'; ... I have the above models. They are related as user-has-one-company and company-has-many-user. When I create a company, a user will be created

Convert the nesting mysql query into codeigniter style

北慕城南 提交于 2019-12-24 06:34:29
问题 I have a nested sql query as below. SELECT A.ID, A.fName, A.lName, COALESCE (B.calls, 0) AS Calls FROM TableA AS A LEFT JOIN ( SELECT COUNT(B.event) AS Calls, B.ID FROM TableB AS B WHERE B.event LIKE 'call' AND `Time` >= 1360540800 AND `Time` <= 1361232000 GROUP BY B.ID ) B ON A.ID = B.ID WHERE A.State LIKE 'SENT' OR A.State LIKE 'SET' I am trying to convert it in codeigniter style. I know Code Igniter's Active Record class does not natively support subqueries. But how could this be done. I