codeigniter-2

Reports in Codeigniter

倖福魔咒の 提交于 2019-12-28 02:34:05
问题 What is the most simplist way to generate reports in Codeigniter framework? Is there any library available to do this task? Except charting what are the other resources to do this. 回答1: Found a nice solution myself. If you want to generate reports in csv format it is very easy with codeigniter. Your model function function index(){ return $query = $this->db->get('my_table'); /* Here you should note i am returning the query object instead of $query->result() or $query->result_array() */ } Now

CodeIgniter's default controller doesn't load

萝らか妹 提交于 2019-12-25 14:29:13
问题 I have inherited an on-going CI v2.0.2 project. I tried loading the default controller - http://localhost/ci202/index.php - but all I got was a blank page. I enabled logging for all messages, and here's the log: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?> DEBUG - 2012-10-05 23:55:41 --> Config Class Initialized DEBUG - 2012-10-05 23:55:41 --> Hooks Class Initialized DEBUG - 2012-10-05 23:55:41 --> Utf8 Class Initialized DEBUG - 2012-10-05 23:55:41 --> UTF-8

CI - show me what went wrong [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-12-25 14:03:05
问题 This question already has answers here : CI - show database error or fail (2 answers) Closed 6 years ago . I've developed a simple login system which works OK but fails, and I need to know why. QUESTION: How to show what is causing the fail? Here's the database function: function login($email,$password) { $this->db->where("email",$email); $this->db->where("password",$password); $query=$this->db->get("users"); if($query->num_rows()>0) { foreach($query->result() as $rows) { //add all data to

Extending CodeIgniter Security.php to enable logging

允我心安 提交于 2019-12-25 06:29:24
问题 TLDR; I want to enable database-logging of xss_clean() when replacing evil data. I want to enable database logging of the xss_clean() function in Security.php, basically what I want to do is to know if the input I'm feeding xss_clean() with successfully was identified to have malicious data in it that was filtered out or not. So basically: $str = '<script>alert();</script>'; $str = xss_clean($str); What would happen ideally for me is: Clean the string from XSS Return the clean $str Input

Is rewriteCond doesn't work with semicolon?

冷暖自知 提交于 2019-12-25 06:13:12
问题 I've ask this rewrite rule for Everything but certain pattern question. Well, the problem is still the same. I have the following htaccess: <IfModule mod_rewrite.c> # Options +FollowSymLinks -Indexes RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} "forum/" [OR] RewriteCond %{REQUEST_URI} "forum" RewriteRule (.*) $1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond

CodeIgniter Active Record select with 2 or more tables

十年热恋 提交于 2019-12-25 04:52:26
问题 I have this sql statement setup in my old code and want to move it over to active record, the problem that I'm phased with is how do I do a SELECT news_items.id FROM (SELECT news_items.* FROM news_items JOIN feeds ON feeds.id=news_items.feed LEFT JOIN news_item_country ON news_item_country.id=news_items.country WHERE news_items.id=30758 ORDER BY date_item DESC ) AS news_items GROUP BY news_items.id ORDER BY date_item DESC Trying to do this with Active Record, first I created the select that

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

Removing index.php on CodeIgniter 2.2.0

帅比萌擦擦* 提交于 2019-12-25 03:55:10
问题 I am running Apache 2.2.22 on Ubuntu 12.04.3 (Oracle VM on Windows 8.1). Using the PHP phpinfo() function I see mod_rewrite in the apache2handler section under Loaded Modules, so mod_rewrite is enabled. I made the following changes to my CI config file (application/config/config.php), $config['index_page'] = 'index.php'; to: $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO'; to: $config['uri_protocol'] = 'PATH_INFO'; I have tried numerous versions this(.htaccess file located in the

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

Multiple M2M in DataMapper ORM issue

自古美人都是妖i 提交于 2019-12-25 02:46:41
问题 I am building a small core piece for my DataMapper ORM library in CodeIgniter to control user's access/edit rights (CRUD) over DataMapper objects itself. For this I want to link a DataMapper Entity , Userrole and Userright together. The documentation is here http://datamapper.wanwizard.eu/pages/advancedrelations.html (Under head; Multi-table Relationships ). So if I fill in the join table by hand I can just get the values without any problems. The only problem is saving the relationship. Here