codeigniter

SimpleTest with CodeIgniter — won't identify file — variables die?

好久不见. 提交于 2019-12-25 04:56:15
问题 I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes. I am using LAMP and NetBeans 6.9. The test.php page loads up in my browser. I have a stub test in place and it shows in the drop-down selections. When I try to run it, I get 2 PHP errors: Message: include_once(/var/www/sparts3/main/tests/basic_test_v.php): failed to open stream: No such file or directory Message: include_once(): Failed opening '/var/www/sparts3/main/tests/basic_test_v.php' for inclusion

Facebook PHP SDK & Codeigniter: Unable to load config

房东的猫 提交于 2019-12-25 04:55:11
问题 my config/facebook.php $config['appId'] = 'XXXXX'; $config['secret'] = 'XXXX'; $config['fb_access_token'] = 'XXXXXX'; my controller: $this->load->library('Facebook'); echo $this->config->item('fb_access_token'); Outputs nothing for the the token? yet I know the library is loading as I can call getAppID ok. It just doesn't seem to be loading this config file. Also tried this from the controller: $this->config->load("facebook",TRUE); $config = $this->config->item('facebook'); $this->load-

how to dynamically set codeigniter library constructor

久未见 提交于 2019-12-25 04:54:08
问题 I am trying to dynamically set a codeigniter constructor, but am having difficulty. I have in my controller: $arguments=array('login'=>'***','pass'=>'***'); ; $this->load->library('mailer', $arguments); $phpmail = new Mailer; $phpmail->sendmail('***', 'bob', 'hi', 'there'); My constructors first line looks like: public function __construct($login,$pass) but I'm getting the following: Message: Missing argument 1 for Mailer::__construct(), Any ideas what I am doing wrong? Thanks in advance,

url not working with browser other than chrome, htaccess file error

与世无争的帅哥 提交于 2019-12-25 04:53:30
问题 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|js|css|images|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] I have written this .htaccess file when I access localhost/myProject/home in Chrome this works fine but in other browsers it show page not found error 回答1: Most likely you need Options +FollowSymLinks . And for more htaccess for codeigniter click on link and download zip At David Connelly's Website. They have about

CodeIgniter Two tables Left Join does not return Join Condition id of left table when miss in right table

拜拜、爱过 提交于 2019-12-25 04:53:13
问题 I have two tables say Table1 and Table2 and i am Left joining Table1 on Table2 with Table1.PrimaryKey = Table2.ForeignKey. It does return all the rows from both tables but in some rows, due to no record in Table2 for the join condition, the PrimaryKey field value is missing for Table1. Here is my code $this->db->select('*'); $this->db->from('CI_Articles_Tbl'); $this->db->join('CI_Article_Images_Tbl', 'CI_Articles_Tbl.roflArticle_ID=CI_Article_Images_Tbl.roflArticle_ID','left'); $this->db-

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

Problem resizing image using Code Ignitor1.7.3

风流意气都作罢 提交于 2019-12-25 04:44:56
问题 Following is the code which resize the image, but here i am not able to resize the image function processHome(){ $this->load->library('image_lib'); $img_path = base_url().'img/image/50X50/ori.jpeg'; $config['image_library'] = 'gd2'; $config['source_image'] = $img_path; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 50; $config['height'] = 50; $this->load->library('image_lib', $config); $this->image_lib->resize(); if ( ! $this->image_lib->resize()){ echo

codeigniter how to enable segment base urls and query string url at the same time

时光怂恿深爱的人放手 提交于 2019-12-25 04:41:13
问题 Please note I am using codeigniter 3.0.3. In my current project I want to use both query string and segment base url. When I enable $config['enable_query_strings'] = TRUE segment base stopped working. I have used all options of uri protocol e.g. $config['uri_protocol'] = 'PATH_INFO'; //REQUEST_URI,QUERY_STRING Is there any way to use both with out any errors. I want to use url helpers in segmented url's and at few places I want to use query strings too. 回答1: Checking URI.php core class, it

code igniter queries: how to build this query

我的未来我决定 提交于 2019-12-25 04:37:37
问题 I am attempting to build a query using code igniter's active records class that looks like this: SELECT * from contacts where account = 1 and (fname like 'k%' or lname like 'k%') however I am not sure how to use the functions to do this. and ideas? 回答1: You can also use the like query $this->db->like('title', 'match'); // Produces: WHERE title LIKE '%match%' And or_like $this->db->like('title', 'match'); $this->db->or_like('body', $match); 回答2: $this->db->where('account', '1'); $this->db-

CodeIgniter: removing 'index.php' from URL

耗尽温柔 提交于 2019-12-25 04:33:39
问题 I have answered this question previously and even posted the answer to it by myself. I tried most of the answered questions, but it still didn't work. The first question is regarding placement of the .htaccess file, should I keep it with application folder or inside it? and the next question is 'How should I remove the index.php from URL'? .htaccess code: RewriteEngine On RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !