codeigniter

Codeigniter - import JS/CSS/IMG properly

亡梦爱人 提交于 2020-01-04 14:35:43
问题 I'm new in MVC learning and after searching for basic stuff, I found several opinions on this question/topic but everyone have different state and instructions... Does anyone know what is the best place to put assets (js/css/img) files in Codeigniter ? I found some guys stating to put it in the view folder, someone in the webroot (after creating an asset folder), someone inside the application folder etc so I really got confused.. Does it really depend on the user who is developing the

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

Multilingual set up of codeigniter

╄→尐↘猪︶ㄣ 提交于 2020-01-04 13:11:21
问题 I'm using this tutorial http://sumonbd.wordpress.com/2009/09/16/develop-multilingual-site-using-codeigniter-i18n-library/ for multilingual in codeigniter. I've follow the instruction listed correctly. It does not gave me any error, but I couldn't say that it is working properly. when I run through mysite.com/en/about and mysite.com/fr/about it always give me the default language which is english. I'm wondering if there is any configuration that I need to set to be able to work properly. I'm

Codeigniter flash data not working in certain browsers

别来无恙 提交于 2020-01-04 11:09:15
问题 I’m having some issues with Codeigniter flashdata. Everything seems to be working in Firefox, but in Chrome (and my mobile BB browser, FWIW) it seems as if no flashdata is persisting between pages. I should note also that everything is ok when I work locally, even in Chrome. But on the production site in chrome, flashdata doesn’t persist. I’ve spent the better part of the evening researching the issue, but no other threads/ideas seem to do the trick. There are no 404s that could be

Codeigniter flash data not working in certain browsers

风流意气都作罢 提交于 2020-01-04 11:08:48
问题 I’m having some issues with Codeigniter flashdata. Everything seems to be working in Firefox, but in Chrome (and my mobile BB browser, FWIW) it seems as if no flashdata is persisting between pages. I should note also that everything is ok when I work locally, even in Chrome. But on the production site in chrome, flashdata doesn’t persist. I’ve spent the better part of the evening researching the issue, but no other threads/ideas seem to do the trick. There are no 404s that could be

CodeIgniter: how to have brackets in a JOIN condition

南楼画角 提交于 2020-01-04 11:01:41
问题 SELECT field1, field2 FROM table1 JOIN table2 ON (table2.field1=table1.field1 OR table2.field2=table1.field2) How to write this query in CodeIgniter? I want to have brackets in the JOIN condition. CodeIgniter sample $this->db->select("field1,field2") $this->db->from("table1") $this->db->join("table2","(table2.field1=table1.field1 or table2.field2=table1.field2)") But this generates an error. 回答1: I would go with the query() function and write normal SQL. Like this: $this->db->query( 'SELECT

Codigniter query returning wrong count

孤街醉人 提交于 2020-01-04 10:20:51
问题 I am using code igniter and I am building a query to return how many people attended an event. So I can take the number and try to work out a percentage. The issue I am having is I am trying to build the query according to Codeigniter 3 Docs, But I am returning the wrong result for some reason and simply cannot figure out why. First of all here is the table in my database I am querying: Here is the function I am calling from my controller: public function get_event_attendance_percentage($id)

Codigniter query returning wrong count

半腔热情 提交于 2020-01-04 10:20:05
问题 I am using code igniter and I am building a query to return how many people attended an event. So I can take the number and try to work out a percentage. The issue I am having is I am trying to build the query according to Codeigniter 3 Docs, But I am returning the wrong result for some reason and simply cannot figure out why. First of all here is the table in my database I am querying: Here is the function I am calling from my controller: public function get_event_attendance_percentage($id)

Realtime Updates in AngularJS

拈花ヽ惹草 提交于 2020-01-04 09:53:05
问题 In an attempt to learn Angular & Codeigniter I have expanded the initial new tutorial (from CI). In it's current stage, it automatically displays new posts & removes deleted posts from the page & of course updates model/DB. -- I assume I'm not doing this the most effective way for AngularJS though. Feedback on my code would be helpful for that. -- However, my main concern is how to do differential updates in Angular? When I accomplished this via jQuery, I simply appended a timestamp to my