codeigniter-2

CodeIgniter Undefined property when loading a model [duplicate]

假如想象 提交于 2020-01-05 08:13:25
问题 This question already has answers here : Codeigniter - I am looking to use/connect to a different database for one of my controllers and one model (3 answers) Closed 6 years ago . I'm receiving the following errors whilst trying to implement a very simple model controller in codeigniter. I'm new to the framework but as far as I can see this should work. I've also tried auto loading the model. I am autoloading the database library. Message: Undefined property: User::$user_model Fatal error:

CodeIgniter Load File with data parameter

纵然是瞬间 提交于 2020-01-05 04:18:29
问题 Is there any option in CodeIgniter to load files with parameters like in views? In my Controller I load this File: $path_to_logic = "extended_core/plugins/saphir_e-cms/be_extensions/$this->modul_id/package/logic.php"; $logic = $this->CI->load->file($path_to_logic, true); I have an array() in the controller that I would pass to the loaded file, like the $data var in the views. 回答1: You need to add this functionality into the Loader class. In order to do that, create a new file named MY_Loader

How to load a view file from within another view with Codeigniter WITHOUT having to pass through a controller?

独自空忆成欢 提交于 2020-01-04 14:03:12
问题 I'm struggling to find a solution to this problem, I need to load a view from within another view. I know, usually, i would just have to do : <?php $this->load->view("smthg");?> But this time, the file path is passed to a data-file tag's property. I have : <a data-file="<?php echo site_url('main/loadCocktailRecipient') ?>/{{Id}}" href="#"> and actually, this is used by a javascript function to load the view by itself. so when doing like so, It load the controller instead of the view file. (or

How to load a view file from within another view with Codeigniter WITHOUT having to pass through a controller?

回眸只為那壹抹淺笑 提交于 2020-01-04 14:01:28
问题 I'm struggling to find a solution to this problem, I need to load a view from within another view. I know, usually, i would just have to do : <?php $this->load->view("smthg");?> But this time, the file path is passed to a data-file tag's property. I have : <a data-file="<?php echo site_url('main/loadCocktailRecipient') ?>/{{Id}}" href="#"> and actually, this is used by a javascript function to load the view by itself. so when doing like so, It load the controller instead of the view file. (or

Why I am getting 'Forbidden' when I try to login on my live codeigniter site?

主宰稳场 提交于 2020-01-04 06:28:05
问题 #Deny from all RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|assets|images|upload|uploads|html|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] This is my current .htaccess file and site is inside a sub-domain directory called clients. You can access the site here: http://clients.creditblitz.ca/ 回答1: Your given url is redirect to 404 page http://clients.creditblitz.ca/authenticate But access below url redirect to 200

Why I am getting 'Forbidden' when I try to login on my live codeigniter site?

╄→尐↘猪︶ㄣ 提交于 2020-01-04 06:27:34
问题 #Deny from all RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|assets|images|upload|uploads|html|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] This is my current .htaccess file and site is inside a sub-domain directory called clients. You can access the site here: http://clients.creditblitz.ca/ 回答1: Your given url is redirect to 404 page http://clients.creditblitz.ca/authenticate But access below url redirect to 200

insert radio value multiple data codeigniter in database to one row?

若如初见. 提交于 2020-01-04 05:32:11
问题 I have a quiz online project i want the answer save like this in database +-----------+-------------+---------+-------------+ | id_answer | id_student | id_kuis | answer | +-----------+-------------+---------+-------------+ | 1 | 99999874465 | 7 | A,B,D,A,C,B | +-----------+-------------+---------+-------------+ this quiz is multiple choice. So how can i insert the data of answer like that. here's my view <?php echo form_open('c_kuis/addKuisAnswer',$atribut); ?> <?php foreach($soalPG as $row)

get logged in user info in CodeIgniter (HMVC & Ion Auth)

女生的网名这么多〃 提交于 2020-01-03 03:44:09
问题 I am trying to get Logged in user details in CodeIgniter (HMVC & Ion Auth) $data['user'] = $this->ion_auth->user()->row(); When i try to display i am getting error Undefined variable: user I am not sure how to get loggin in user id or email. I need id or email. Please help 回答1: If your are trying to display it in view, Are you passing the $data variable to the view ? $data['user']=$this->ion_auth->user()->row(); $this->load->view("filename",$data); If you are trying to access it with the

SEO-friendly URLs in CodeIgniter without the use of slugs?

六眼飞鱼酱① 提交于 2020-01-01 11:55:13
问题 Is there a way (via routing) in CodeIgniter to change: example.com/category/4 to example.com/category/foo-bar where Foo Bar is the name of category 4 in the database? Access from the SEO-friendly URL should be allowed, but access via the integer should cause a 404 error. This should also work dynamically, where any integer is automatically converted to a URL-safe version of its corresponding category name. I've seen a few solutions that use 'slugs'... is there a decent alternative? Thanks.

Authentication in jQuery Mobile and PhoneGap

故事扮演 提交于 2020-01-01 03:23:12
问题 I have a web application built with jQuery Mobile and PHP (CodeIgniter framework). Now I'm trying to make a PhoneGap version of it as well, to make it distributable as a standalone app. However, the PHP web app. version uses Ion Auth, a CodeIgniter plugin for authentication. So when you go to a page that requires authentication, the app redirects you to the authentication controller login method. And after authentication it redirects you back to the home page (the jQuery Mobile page in this