CodeIgniter Training: Learn HMVC: Video 9
CRUD part 2

Leave a Comment

maqs (Monday 25th of June 2018 at 11:02:52 AM, GMT)
Check these links:

danhtinh (Thursday 31st of May 2018 at 10:36:20 AM, GMT)
ADDITIONAL RESOURCES Link has died. Any firends here can share? Thanks.

james (Wednesday 23rd of August 2017 at 09:08:59 AM, GMT)
Hahahah Your so gifted Sir David.

james (Wednesday 23rd of August 2017 at 08:49:32 AM, GMT)
A Big Help Thank you David.

gansoteles (Monday 24th of April 2017 at 05:01:55 PM, GMT)
Great work and many thanks!

I liked the template code. Its super simple and easy!

silentknight (Thursday 13th of April 2017 at 02:16:17 PM, GMT)
Great Work (Thursday 18th of August 2016 at 02:10:04 PM, GMT)
Thank you man

SkYHeX27 (Monday 15th of August 2016 at 04:04:50 PM, GMT)
David...!!! please

SkYHeX27 (Sunday 14th of August 2016 at 04:03:29 PM, GMT)
hey David please reply

SkYHeX27 (Friday 12th of August 2016 at 03:56:20 PM, GMT)
hEY, is there a problem with my codes, it always says that undefined variables, the view_file and the module on Templates controller? can you help me? thank you..

Davcon (Sunday 12th of June 2016 at 08:49:13 AM, GMT)
Great comments, Muncher. Thanks for that.

muncher791 (Thursday 11th of February 2016 at 09:24:20 PM, GMT)
Hi, great vids David - having an issue with this one if you or anyone can help. When I include the xss_clean as in the video following a | I get the following error

Unable to access an error message corresponding to your field name Priority.( xss_clean)

If I remove the | but keep the xss_clean, no issue but maybe then the xss_clean isn't working? Any help much appreciated

prashant (Tuesday 9th of February 2016 at 10:13:55 AM, GMT)
Thanks for doing the task in simplified way. You really turn my approach. I remember you said in your video about one module per table. I request you put some light on table join. I was expecting in CMS but can't find. Where do we write such table join queries ?

extra123acct (Monday 11th of January 2016 at 11:14:09 PM, GMT)
Tyvm for your awesome videos! You are the king... you rule!

adepentane (Tuesday 22nd of December 2015 at 01:31:53 AM, GMT)
I have just one question in this Section....CRUDE......Now, i still could'nt figure out all the codes that made up the Tasks controller file.(tasks.php). If any has the code, please kindly mail it to . I hope i get it right in time. This series is so intresting. THANKS ALL.

jjohnsonjr48 (Sunday 15th of November 2015 at 07:21:23 PM, GMT)
David. I joined recently and I love your HMVC stuff. Love your style and you make it clear. It has been a few years since the videos so I certainly hope your cough is better by now. But in trying to access your Htaccess Samples zip file, the link redirects me to instead of allowing download of the zip file. I may figure .htaccess out before you fix the link (my first try from video did not work), but I figured you would want to know about the link problem. Jim

Unknown (Sunday 8th of November 2015 at 12:28:19 AM, GMT)
I like your style .... the template approach is brilliant. I spent two years fooling with different template libraries, scratching my head over each one .... love your approach.
San Diego, CA

patrice (Tuesday 6th of October 2015 at 09:27:19 AM, GMT)

Thank you very match for your job.

Patrice from France

goljavi (Saturday 19th of September 2015 at 02:00:39 PM, GMT)
Hey David! Thank you for all your videos, they are just amazing!
Greetings from Argentina!

siddhu (Saturday 19th of September 2015 at 05:59:38 AM, GMT)
Dear David, every thing is fine till here. In this video lesson 5, I have many doubts . Where you are explained the simple template. it seems like very easy. But if we have big template which include jquery, bootstrap, header and footer usually we create a folder like "assets" for css, js like this stuff. it has many files.
So, my doubt is ?
Shall i create a "assets" folder for every individual module ? is this good idea ?
Please help me. Thank you :-) you are simple awesome :-)

rajppd (Friday 28th of August 2015 at 08:25:05 AM, GMT)
Dear David,
Just wanted to thank you for all the nice videos and the jokes!

stleo71 (Tuesday 18th of August 2015 at 01:51:02 PM, GMT)
Salutations David, Wanted to thank you for sharing this with me. I understand how easy it becomes when you separate the items on the site. Still a little fuzzy on how to use controller, view, and model structure. I still code thinking all in one.

Unknown (Sunday 16th of August 2015 at 05:28:08 PM, GMT)
where is a "mdl_perfectmodel.php" ??

ux.chandra (Thursday 30th of July 2015 at 03:57:21 AM, GMT)
Hi David,
The form validation callback is not working for CI V3. Applied your solution , but failing to get a solution. Can you please post a solution .

web_code (Sunday 26th of July 2015 at 02:47:12 PM, GMT)
Hi David, thank you for the welcoming and also, thank you for the amazing videos, you make them fun.
I get an arror when I try to use the form, after I put all the validation an all is done, I get
Fatal error: Call to undefined method MY_Loader::_ci_load_library()
I am new to codeigniter, so I tried to find the solution but have not found one.
Thank you.

db.pinggoy (Monday 22nd of June 2015 at 11:59:45 PM, GMT)
Hi David, I follow along your video on hvmc setup but i got this error." Fatal error: Access level to MX_Router::_set_default_controller() must be public (as in class CI_Router) in D:\DANTE\APP\EasyPHP-DevServer-14.1VC11\data\localweb\myweb\application\third_party\MX\Router.php on line 241", when i try set that into public i got another error "Undefined property: MY_Router::$translate_uri_dashes". I am newbie to codeigniter i hope you can help me with this. thanks

Brightside (Monday 4th of May 2015 at 08:15:43 AM, GMT)

penderci (Friday 3rd of April 2015 at 03:51:31 PM, GMT)
Thank you for the videos! I really learned a lot. Looking forward to watching the rest :)

jomarllevado (Tuesday 17th of February 2015 at 11:53:05 AM, GMT)
Hi David, this tutorials are fantastic, not only because it's informative but I also enjoy the way you deliver it. I do enjoy your Scottish "ACCENT" if I'm not mistaken. I look forward for more tutorials in this site, and hopefully I could become great in this craft :).

ehhemmmm.. I hope you'll create a tutorial on how build your own simple PHP framework from scratch. hehe

Cheers!! ^_^

imran300 (Wednesday 11th of February 2015 at 07:30:52 AM, GMT)
hello David,
i am new here so i have got some shit problems..
i am having this errors. i just copied everything and m using CI v 2.1.3

A PHP Error was encountered

Severity: Notice

Message: Undefined property: MY_Router::$translate_uri_dashes

Filename: MX/Router.php

Line Number: 50

An Error Was Encountered

Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.

vortex (Monday 9th of February 2015 at 06:34:11 PM, GMT)
Hi David, fantastic tutorials , I agree fully with your 5 rules! For me as an aviator the KISS (Keep It Simple and Stupid) principle an do one thing at a time.
I have the same problem with the form_validation, but only in Codeigneiter 3.0 , 2.x.x is working fine.
Has anybody a solution? Thanks!

ux.chandra (Friday 6th of February 2015 at 10:07:27 AM, GMT)
Hi David, While using HMVC my form validation call back function is not working, , how to make it work.

I am really stuck in this, please help me out.

helloworld.avi (Thursday 22nd of January 2015 at 07:42:31 PM, GMT)
Yeah these tutorial are awesome! I love it and am making my hand dirty with it!
Now I am facing the issue that during formvalidation when the codition is false the create() function loops continously. Pls. need solution to this.
Thanks in advance :)

mannyf (Saturday 10th of January 2015 at 06:22:05 AM, GMT)
Hi David, I was just paranoid, I was able to run it now, thanks very much, I like your modular and templating techniques I will try to follow it, more power to you, I greatly appreciate your effort in sharing your brain... he he ha ha, you good man, I hope you will be more Blest to continue this good work...

mannyf (Saturday 10th of January 2015 at 06:13:52 AM, GMT)
Hi Davin, Thanks for these fantastic video tutorials, I like your tutorials. I have a question, I can't run the modular HMVC extensions with codeigniter 2.2.0 do you know of the trick? Thanks,

drc83 (Friday 9th of January 2015 at 09:56:42 AM, GMT)
oops thats what happens when you try to follow a tutorial at 2am!!!! Simple error:

$this->load->model('mdl_tasks'); and not $this->load->model('mdl_tasks.php');

drc83 (Friday 9th of January 2015 at 03:00:04 AM, GMT)
Hi David fantastic videos! I know this was posted a long time ago, but just working through your example I am getting the following error: Fatal error: Class 'Mdl_tasks.php' not found in /htdocs/codeigniter/application/third_party/MX/Loader.php on line 209

this is the code for my mdl_tasks.php file:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Mdl_tasks extends CI_Model {

function __construct()
// Call the Model constructor

function get($order_by) {
$query = $this->db->get('tasks');
return $query;

and tasks.php file is as follows:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Tasks extends MX_Controller {
public function index()
echo "

Tasks Controller

$query = $this->Mdl_tasks->get('priority');
foreach($query->result() as $row){
echo "



Please can you help me with this

jeziah31 (Wednesday 31st of December 2014 at 02:42:49 PM, GMT)
And now I'm working for our capstone project.. And hoping to finish with the help of your tutorials.. your such a blessing for my group :) . Stay a blessing to others and may God Bless u More!

jeziah31 (Wednesday 31st of December 2014 at 02:36:42 PM, GMT)
I'll been watching your videos and it's helped me a lot about my project.. my Instructor just introduce to us the most basic codes in codeigniter then required us to have our final project using codeigniter and i don't have much about it.i fine it so stressful at first, but after i watched your videos i fine it easy and cool :) .. i finally done the project with the help of you tutorials .. thank you ;) .... and its so cool my instructor got amazed during the project defense because the doesn't knew about the modular coding and i introduce your tutorial to him :) .. your amazing and thank you for sharing your knowledge to everyone.

GRamone (Tuesday 30th of December 2014 at 07:16:37 PM, GMT)
i watched lot videos on youtube about web development but yours is super easy to understand... i agree with side you are my super hero too...

jibagast (Sunday 14th of December 2014 at 10:41:29 PM, GMT) countryman keep up the good work. lol your story about your first PHP job at the police station was amazing!!

siddhu (Thursday 27th of November 2014 at 02:52:48 AM, GMT)
You are my super Hero !

Unknown (Thursday 13th of November 2014 at 06:44:17 AM, GMT)
Hi, this is very usefull flow to learn HMVC pattern. when I developed the same process in my localhost the index.php is displayed in the url path when click on Edit link and redirect to task controller. what would happend in my code...

mjtorres (Wednesday 22nd of October 2014 at 05:25:00 PM, GMT)
Thanks so much.... for share your knowledge... saludos desde EspaƱa!

lance1572 (Monday 20th of October 2014 at 06:25:13 PM, GMT)
Show ME the Vibe!!! :)

SherLambo (Wednesday 8th of October 2014 at 01:28:12 PM, GMT)
Hi David, thank you for your video and ... I love the shirt! I got mad because get stuck always at the very beginning of having codeigniter run. I have a Mac OSX 10.6.8. localhost/ says It works! Maybe I only choose the wrong place for the codeigneiter or hvmctest. It doesn't say welcome to codeigniter. So far, can't start rocking in the free world. Can you recommend somebody who could solve this "probably easy" prob with me. Didn't want to create a thread for this. Anybody out there who had the same prob. Thank folks. Glad that codeigniter has a new owner!

lance1572 (Tuesday 23rd of September 2014 at 05:54:55 PM, GMT)
7:28....he's so sick he's delirious!!! Good stuff!! :)

ferdythebull (Monday 15th of September 2014 at 07:23:40 AM, GMT)
David, you are absolutely fantastic.

I was in a real bind before I came across your youtube videos, and I have to say that you have not only helped me exit that bind, but you've got me excited about PHP once again.

Thank you SO much.

lumenotti (Friday 5th of September 2014 at 05:05:32 AM, GMT)
I agree with all. Thank you David for making your training material available.

kanha (Monday 1st of September 2014 at 03:35:57 AM, GMT)
awesome, but I still got wrong with .htaccess :S

tanimkg (Friday 29th of August 2014 at 03:44:36 AM, GMT)
You are the best online instructor on web development/codeigniter that I ever came in contact. May almighty bless you for you have given valuable tips, lessons free of cost

lance1572 (Wednesday 27th of August 2014 at 09:44:38 PM, GMT)
This guy is awesome!!!

shimanto28 (Wednesday 27th of August 2014 at 07:04:00 PM, GMT)
May Allah bless you for your owesome advice, tutorials, personality David.
You just love codeigniter we know that but
Would like to make a complete site tutorial with laravel ?
Way of your explanation is very subtle and simple.
If you create a series of tutorials of one whole site using laravel it helpful for your tons of followers.
I wish you all the very best :)

kalitsingh (Tuesday 12th of August 2014 at 05:40:35 AM, GMT)
I have not find perfect model and perfect controller code on your site. As you have shown in your videos.
please sort it out and provide the valuable code to us

shiwamavg (Wednesday 6th of August 2014 at 10:47:08 AM, GMT)
Tnx sir, for ur wonderfull lessons..
it helped me very much...

vikram (Friday 25th of July 2014 at 08:29:44 PM, GMT)
in additional resources there is no perfectmodel and controller

rodrigokbsa (Friday 25th of July 2014 at 03:06:58 PM, GMT)
Great videos. Thanks for sharing!!

The link of perfectmodel and perfectcontroller down working. I need to download this!! =D

elytista (Thursday 24th of July 2014 at 05:56:35 AM, GMT)
wheres the deleteconf code sir david?

SH (Thursday 17th of July 2014 at 04:23:50 PM, GMT)
Access to perfect model / controller code would be awesome - the tuts are excellent.

ahmershuja (Wednesday 16th of July 2014 at 03:40:06 AM, GMT)
from where I can download your source, also .htaccess file I couldn't find it.

junlax (Thursday 3rd of July 2014 at 03:46:09 AM, GMT)
i did created my own perfect model using much like the strategy of yours. its really amazing. it saves so much time.

junlax (Thursday 3rd of July 2014 at 03:46:07 AM, GMT)
i did created my own perfect model using much like the strategy of yours. its really amazing. it saves so much time.

r.costa (Tuesday 3rd of June 2014 at 08:15:50 AM, GMT)
Where is the "HMVC Stuff" ? I need the code for the Perfect Model !!!

aneal (Saturday 10th of May 2014 at 01:54:57 AM, GMT)
thank you sir for all these awesome videos. It really helped me to boost up my HMVC concept .... :)

Nata2310 (Friday 9th of May 2014 at 01:51:43 PM, GMT)
Hello David, Thank you so much for these helpful videos. One question: is it just me or the both links of the perfect controller and the perfect model don't work? The code, you are talking about in this video is not available :(

mmsdhinesh (Thursday 8th of May 2014 at 07:29:40 PM, GMT)
Its really very useful , thanks mrs.david

Unknown (Friday 2nd of May 2014 at 07:16:59 PM, GMT)
Thank you for making this so easy and humourous to watch. Very much appreciated! Tell your cat I say hey.

markandrew (Saturday 29th of March 2014 at 11:16:07 AM, GMT)
Impressive! I have a question though. What if I have a table for users, then I want to create a login page. Should I create a login module and a separate users module? If so, should I delete all the functions that came from the perfect controller in my login controller? Sorry but I'm just thinking maybe there's use for those functions.

bytebank (Friday 28th of March 2014 at 10:15:30 AM, GMT)
Can you make a video with a sample for cross-joining tables? Thanks again.

gunberi (Thursday 27th of March 2014 at 11:22:20 PM, GMT)
Thank you. This video series is very useful to me.

bytebank (Thursday 27th of March 2014 at 03:36:57 PM, GMT)
You are a really great teacher. Hope to see more tutorials from you. Really the best!

firooze (Friday 21st of March 2014 at 04:50:47 PM, GMT)
thank you david, this series was really great.

anil3a (Tuesday 18th of March 2014 at 03:19:41 PM, GMT)
Superb lessons. Just that Video quality should have been a little good.

irma (Sunday 16th of March 2014 at 01:04:54 AM, GMT)
Thank you DC. Your lessons are perfect!!! ??????? ???????? ?????. ???? ????? ?????? ? ????? ?????!!!

Gesso (Wednesday 26th of February 2014 at 02:21:40 PM, GMT)
Next ... : -> ()

berlima (Monday 13th of January 2014 at 03:18:20 PM, GMT)
nice! .... hope can see more tutorial codeigniter from you ...

wahyu_am (Sunday 12th of January 2014 at 01:16:32 AM, GMT)
great! the tutorial is back again, Thanks David :D

sosa1985 (Friday 6th of September 2013 at 09:04:26 PM, GMT)
hi jimmylad where i can send .htaccess file & nofun.php & other files to download them & check my problem

Michel Maldonado (Sunday 1st of September 2013 at 05:20:05 PM, GMT)
Well I don't understand why my name isn't showing up in my message below.. Hopefully now it is!

Unknown (Sunday 1st of September 2013 at 05:17:36 PM, GMT)
Thank you so much for these great tutorials, i think you're a very cool programmer and a good teacher!

jimmylad (Saturday 31st of August 2013 at 12:23:45 PM, GMT)
Hi sosa, can you copy and paste the contents of your .htaccess file on here and also your nofun.php file.
Ill take a look later on today.
Did you install everything correctly and run "all" of the earlier videos?
Just a longshot if everything is installed ok
I believe some users were having problems with Apache and windows 8 UAC, I did a fresh install of XAMPP after Downloading and running tweakUAC to turn off my UAC.

Davcon (Friday 30th of August 2013 at 11:58:07 PM, GMT)
Sosa, I'm really sorry but I'm not able to offer any technical support right now because I'm working on some more content for the Insider Club and very sadly I have no time to spare. I recommend posting your questions on the forum and I'm sure someone who knows more then me will be delighted to help you.

Davcon (Thursday 29th of August 2013 at 02:01:59 PM, GMT)
Thank you. I'm good thanks. Hope you are too!

aashish (Wednesday 28th of August 2013 at 03:29:03 PM, GMT)
hi David .. how you doing man .. thank you for the videos ..

jimmylad (Tuesday 27th of August 2013 at 10:54:36 PM, GMT)
Fixed the problem, I thought netbeans was autosaving but didnt! problem solved!
Dave thanks a bunch for the videos these are a real inspiration to us less technically gifted!

jimmylad (Tuesday 27th of August 2013 at 10:47:52 PM, GMT)
dave, not sure how i manged to post that below i must have timed out! Im having same problem as sosa1985 getting a 404 on the nofun page, followed instructions perfectly...any ideas?!

Unknown (Tuesday 27th of August 2013 at 10:44:17 PM, GMT)
Dave,loving these vids, just followed this to a tee and im getting a 404 on the nofun page at the end! any ideas?
Looks like im the same as sosa1985 !

plusgforce (Thursday 22nd of August 2013 at 03:09:09 AM, GMT)
Thanks Dave! Problem solved!

Davcon (Wednesday 21st of August 2013 at 08:16:45 PM, GMT)
Hi Philip, Gee, I don't know. I'm not very good at js. Why don't you post it on the forum? There's people there who know much more than me.

plusgforce (Wednesday 21st of August 2013 at 07:03:27 PM, GMT)
echo $BASEPATH doesn't work so I was wondering if there was another way to pass the current dir to all of the js and css scripts.


plusgforce (Wednesday 21st of August 2013 at 06:49:57 PM, GMT)
<title>One Page Template For Startups</title>
<!-- Import CSS -->
<link rel="stylesheet" href="css/main.css">
<link href="//" rel="stylesheet">
When I load this view the scripts and css don't work. Is there an easy fix that requires only a couple of lines of code? I love your tutorials and hmvc!


Davcon (Wednesday 21st of August 2013 at 11:32:17 AM, GMT)
shamoer - Yes, that's right. It was just an example and just my attempt to clarify that the file was a model and not a controller. Thanks for your positive feedback.

shamoer (Tuesday 20th of August 2013 at 11:34:34 PM, GMT)
figured it out in following videos... /facepalm. As it was just set as example. :)

shamoer (Tuesday 20th of August 2013 at 10:02:24 PM, GMT)
i might have i silly question, but in the Perfectcontroller you're reffering to mdl_perfectcontroller, but shouldn't it be mdl_perfectmodel? if not, can you tell me why, bit confused by this.
And by the way, except from this little questionmark in my brains, thx a lot for making peoples' lifes so much easier e.g. mine!! you're EPIC :)

Davcon (Monday 19th of August 2013 at 03:13:36 PM, GMT)
Thanks Makha

makha (Sunday 18th of August 2013 at 10:47:15 PM, GMT)
these are awesome :D

I dont know your email, so I just say my thanks here to produce these awesome video :)

Davcon (Sunday 18th of August 2013 at 02:27:04 AM, GMT)
KLS, everyone who uses PHP frameworks has that challenge. It's all part of the game and you just have to modify and adapt when those moments come. I don't use any special plugins for NetBeans.

klsmith (Friday 16th of August 2013 at 10:28:04 PM, GMT)
What NetBeans plugins do you use?

klsmith (Friday 16th of August 2013 at 08:01:10 PM, GMT)
I have been looking at CI for a while. The biggest issue I had was figuring out how to deal with the URL when building a CMS. You resolved that issue. CI is back on my radar. I really enjoyed watching you build the CMS in record time. I very much look forward to seeing the rest of your videos.

The biggest question I have is what is your plan for dealing with CI and the HMVC library getting out of sync - you know what happens if CI upgrades and it breaks the HMVC lib and the lib is never upgraded?

Thank you for sharing all these tips and tricks.

Davcon (Sunday 4th of August 2013 at 10:41:15 PM, GMT)
Sosa, don't worry about it. Try sending emails online and if that doesn't work then you have a problem, but in the meantime localhost (offline, I think) not firing emails isn't a problem. It's normal. Relax!

sosa1985 (Sunday 4th of August 2013 at 12:19:56 AM, GMT)
i have a very big problem when i send smtp mail using codeiginetor from local host to gmail or any other email i didnt get the solution & have these error : Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

Filename: libraries/Email.php

Line Number: 1553

iam using php5 & AppServ2.5.10 local host

i need any help for that i can send to you my code but i want your email to send it

Zhenyah (Saturday 3rd of August 2013 at 10:56:20 AM, GMT)
I very like your lessons.

Nima (Wednesday 31st of July 2013 at 04:56:38 AM, GMT)
I did exactly as you did in your video but when i type in the nofun into my URL it takes me to phpadmin page
why ?

sosa1985 (Friday 19th of July 2013 at 03:00:20 AM, GMT)
thanks very much for htaccess samples & its very good response

Davcon (Thursday 18th of July 2013 at 11:59:32 PM, GMT)
Hi. Thanks for your positive feedback. I've added some htaccess files to the resources section for you. You can also get them from the downloads page.

sosa1985 (Thursday 18th of July 2013 at 06:01:44 AM, GMT)
really its wonder full but please i want the code of removing index.php from address bar in written document because it is not clear in video

dreamer (Friday 12th of July 2013 at 02:33:00 AM, GMT)
I'm a newbie with codeigniter...and thanks a lot to your series of tutorials David...Big time man!
I'm looking forward to your other videos..This really helps me a lot..I'm now starting to appreciate more what codeigniter is all about..Thanks to you man...:-)

Valiente (Wednesday 10th of July 2013 at 06:02:44 AM, GMT)
You are a very awesome person!

whiterabbitz (Tuesday 9th of July 2013 at 11:42:56 PM, GMT)
Content below was seriously reformatted!
Perhaps a small enhancement on your comment filtering to allow line breaks?

whiterabbitz (Tuesday 9th of July 2013 at 11:40:47 PM, GMT)
Hi David and All.

Two things I have come across re codeigniter:

1) Sesions seem to sometimes die specifically when using Ajax.
Found this solution: No credit on my part only a deft hand at google search
"Create a MY_Session.php library in application/libraries": See code below:

2) Have been playing around with MY_Model and MY_controller in application/core.

MY_conroller extends MX_controller and all new controllers extend MY_controller. Makes for nice modular code.

You can then set up (I used library ) and added admin_controller and user_controller than extend MY_controller. So for example in admin_controller you can validate user login for all admin pages in 1 line of code. But don't forget to exclude login/logout and register pages or recursion abounds.

Also have borrowed your perfect model and put it in MY_Model - This means all the CRUD is available immediately in all new models that extend MY_model by simply setting a global in the new model specifying the table - any any other specifics for that table/model combination

Seems to work well.

Any comments as why this may be Bad? or Good

Keep up the good work!

Code for session timeout
class MY_Session extends CI_Session {
* Do not update an existing session on ajax calls
* @access public
* @return void
public function sess_update()
if ( ! (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') )

Will Fix sessions for ajax

zendo108 (Monday 8th of July 2013 at 01:21:32 AM, GMT)
First of all thx vmuch frpo taking the time to teach this stuff and for all of the noobs out there like me following this tuts when doing the .htaccess file thingy you have to make sure too that AllowOverride is AllowOverride All on httpd.conf.
I personally struggle with this for a bit and ofcoures restart (m|x|w)ampp?
I hope it's ok to make this type of clarifications here in the comments :)
The httpd.conf on a mamp install

Unknown (Friday 5th of July 2013 at 03:25:15 PM, GMT)
sorry i cant delete my comments.. here's an even shorter version which you won't have to edit if you change database/form
public function get_data_from_db($update_id) {
$query = $this->get_where($update_id)->row();
return get_object_vars($query);

Unknown (Friday 5th of July 2013 at 03:13:10 PM, GMT)
3:59 save yourself a foreach and do
$row = $query->row()


Martyn (Thursday 4th of July 2013 at 04:29:58 PM, GMT)
Just finished the HMVC tutorials David and I think I'm in over my head haha.

I'm looking forward to trying the CMS tutorials. You've inspired me once again :-)

SphericalBoy (Monday 1st of July 2013 at 04:45:21 PM, GMT)
I'm so glad I came across your site. I'm just about to build my first CMS from scratch/ish using Codeigniter and your presentations style is just pitched at my level!

Davcon (Friday 28th of June 2013 at 11:18:44 AM, GMT)
Thanks Perosurac

Davcon (Friday 28th of June 2013 at 11:18:05 AM, GMT)
whiterabbitz, The answer is yes. You could do that and you're absolutely right. I'm planning on covering that in a future video and calling it 'advanced HMVC'. For the moment though, I wanted to just keep everything nice and simple to get people out of the starting blocks. We can go into extending classes and all that stuff another day. Thank you for your feedback. I'm grateful.

whiterabbitz (Friday 28th of June 2013 at 08:08:55 AM, GMT)
Thanks for the videos. Have been using Zend, too big, too complicated, too Slow.
The Hmvc modular approach is really my thing. Just pick up a module and re-use it in another project.
One question, with the perfect controller and perfect model, would it not be possible to pass through the table name and set up 1 db model? Or have I missed something?

Perosurac (Friday 28th of June 2013 at 07:07:59 AM, GMT)
Nice enhancement of the site David. Thanks for the job and for sharing !!!

Davcon (Wednesday 26th of June 2013 at 12:13:51 PM, GMT)
Thank you jd

jd7777 (Wednesday 26th of June 2013 at 02:40:14 AM, GMT)
Awesome videos.
Thank you for the time and effort you put into these videos.

Davcon (Monday 24th of June 2013 at 09:06:54 AM, GMT)
Thank you Garrick.

garrick (Monday 24th of June 2013 at 04:19:22 AM, GMT)
This is a great series! I can't wait for more Codeigniter videos, hopefully some on extending the use of the calendar library!

© Copyright 2013 - 2018 David Connelly | |