Continuing on from Day 3, we’ll expand our little application into a simple newsletter signup form. This will allow us to taker a closer look at both the email and the form_validation classes. Learn it all in this 30 minute screencast.
Catch Up
Day 4
If you’re having trouble viewing the video, watch it here instead.
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for more daily web development tuts and articles.


I spent most of yesterday refreshing my browser…waiting for the next installment in the series! *blushes*
Thanks, Jeffrey, for continuing the series. (And no, I haven’t watched this video yet. ;) )
Me too – thanks for continuing the series Jeffrey!
Thanks, guys!
Okay…just finished it! “Fully awesome!” :D
Watching the tut…
thanks
thank you jeff, i am building my knowledge base only from you.
Nice! Just one little thing:
Did’nt you say in the first video that you would walk the “readers” thru writing an CMS? We are already in video 4 of 10 and it’s still very basic stuff going on (only fetching from database). To me the email-class seems like it should be coming a little further down the line…
The quality is very good though, and I hope you’ll continue with the series.
I can’t begin teaching how to build a CMS until I’ve taught the basics.
Keep in mind that this series is for beginners who have no experience working with the MVC pattern. It takes time… :)
That email label’s for attribute references the name input incorrectly. Sorry to be a pedant! :)
Good stuff Jeffrey!
The label references the id of the input.
Yeah – I know what the ‘for’ attribute is um… for :)
Your second label’s ‘for’ attribute associates it with the first input (the name input.)
The second label’s for attribute should have a value of email.
Oh, hehe. I guess that ruins the entire tutorial then. :)
I’m sure we can let you off, just this once ;)
(And I did apologise :) )
gonna watch, should be a nice one as usual :)
Well done Jeffrey!
Just a little thing, you did not xss_clean the input fields ‘name’ and ‘email’, maybe you are using global xss cleaning? I think especially beginners should learn to use this every time they work with user input.
Apart from that, thanks for the tutorial, great work!!!
Did I not mention turing on global xss cleaning in the video? I thought I did. If not, we’ll go over that in Day 5.
Keep them coming Jeffery! All of these screencasts allows me to get a better grasp of the MVC pattern.
Jeffrey why dont you just press cmd+tab instead of using this silly window explorer
Because I don’t.
Its much more Swoooooshy to do it like that, don’t you agree? :) Great tut Jeff, look forward to the rest!
Yes! Chicken enchiladas and CodeIgniter. It’s a great day! Thanks Jeffrey!
thanks jeff, i just started from Day1.. hehe.. i would like to teach this on my class also, im using your video tutorials about “jquery for absolute beginners” for my class now..
is there a way i can download your complete video tutorials about jquery?
Thanks!
Go to iTunes and search for “Nettuts.” They should come up for download.
I think updating a database should be included in the next tut. These are great videos! Thank you!.
Awesome, thanks from Spain :)
Another David from Spain here ;-)
+1 from Madrid, Spain.
Question 1:
Is there a difference between the config you created (system_root) and the url helper (base_url)? If so, can you please explain.
Question 2:
I’m new to MVC so I was wondering why the $name_data array is set in the view instead of the controller and then passed to the view. The real question is when should variables be set in the controller and when should they be set in the view?
Thanks. These tuts are amazing!
If you would write a big website, how do you keep things organized? Do you use subfolders for your views/controllers?
Yes, if you have i.e. a site with an admin backend then you should use subfolders.
f.e.
-views
-welcome.php
-register.php
–admin
—index.php
—module1.php
—module2.php
How to you call controllers in subfolders?
thx. :-)
Controllers are called over the URL…
domain.com/subfolder/controller …
@harton
Simply use:
$this->load->view(‘folder/file’);
Note that you can only use one subfolder. If you use 2 or more, it will fail.
Ups, i think i’m tired.
Ignore my previous comment!
I follow the convention of putting all my views in a folder named after the controller, so:
BLOG
-Index
-Comments
– Etc
ADMIN
– Index
– Users
And call them like:
$this->load->view(‘blog/index’);
Just my method, but keeps things nice and organised!
Hey guys, I am just waiting for the tutorial to load and I am going to watch it later, great series by the way.
Can I ask if you would consider offering us a download link to the video file as well?
You can download all nettuts videos in iTunes (search NETTUTS), or from blip.tv (in 2 qualities). This video is here: http://nettuts.blip.tv/file/2466799/
Hi Jeff,
great tut. :-)
One questions though:
Can you also use “return;” at a method in case you want to abort its action?
Considering your next tut:
It would be cool if you can show a tut that passes variables from the view into the controller up to the model and back.
thanks for your great work :-)
cheers
harton
Loving this series, keep em coming!
Though I don’t use CI (or any framework for that matter), I still enjoy watching these screencasts. I thought it was funny at first when you were typing the rules and didn’t have them as strings. I was thinking to myself that PHP would parse them as constants, which it did.
However, my favorite part has got to be the jQuery reference. This is why I love your videos, Jeffrey. They are always funny even if you don’t mean to make them. :P
CI evangelism at its finest.
Another great tutorial in this series. I’ve really been taking away a lot from each video and even read ‘CodeIgniter for Rapid PHP Application Development’ in 3 days after following the first tutorial.
This is definitely one of the best video tutorial series to date from Nettuts…maybe even going to be better than the jQuery series. Thanks for the knowledge share!
I was following along just fine until about 22 minutes in. In the tutorial when you pressed the Submit button to send the empty form, the page reloaded with error messages displaying. When I tried it on my setup, I got a 404 not found error. I’m not exactly sure why, as the send function is included in my email.php controller file. Do you know what might be causing this error?
Never mind – I figured it out. It had to do with the configuration of my base_url, although I don’t know why it worked fine in episode 3 but not episode 4.
My guess is that you forgot to rename the base_url within the config file to day4 (instead of day3)??
Hey Jeff, was wondering if you could maybe keep the names of each video the same like Codeigniter: Day x or w/e I have to keep changing them so they get added to my smart playlist in iTunes. Would make it look a whole lot more organised.
But apart from that they’re great.
Thanks :)
Hi Jeffrey Way,
Thank you for this tuto.
I search a tutorial of MVC symfony framworks,
Can you post a tutorial about this MVC
Thanks again
For anyone trying to make the download files work, the following needs to be changed:
1. Go to the routes.php in the application>config folder. Change the default controller from ‘site’ to ‘email’.
Mr. Way, the index function in your ‘site’ controller is missing a semi-colon and the closing curly brace.
Just watched it. It’s great. :) Wondering when Part 5 is out?
Around next Tuesday.
Can’t wait :D
That’s great! Thanks :)
Thanks! Jeffrey…I think this is better than Day 3..because you’ve taught lots of good stuff right there…
In day 5…
how about we use some more sessions ?or use some javascript library like jQuery
I cant wait really for day 5..
yay!
Nice one. I might be jumping the gun here, but it would be cool to see a tutorial or two on using some of the third-party libraries (http://codeigniter.com/wiki/Libraries):
- IgnitedRecord for ORM
- Tank Auth for Authentication
- Modular Extensions for HMVC
Something along those lines. I’d also really like to see a tutorial for creating an admin area, but I understand you need to teach the fundamentals first. Either way, keep the CI tuts coming!
Those are very nice tutorials.
CodeIgniter should know about this and put a big link here. Very nice stuff. I’m absolutely new on frameworks, I have played a little with OOP so those tutorials feets like a charm.
I will however, not follow a path of lets use nice features BUT, lets learn more about basic features. Once we have the basic, we can move on on more complicated stuff.
For example: Build a menu, a pagination, working with joins… this kind of stuff, it’s the basic, but will allow us to properly develop.
Regards,
MEM
great ! Thanks ! Keep on Jeffrey you’re doing a good job !
Jeff,
Nice screencast. I am glad you still are doing this. I wanted to know if you would be doing one with jquery used to do ajax and all the fun stuff you taught us with the jquery screencasts? anyways love all the screencasts so far and here’s to more good stuff. Keep it up sir!
Sweet! Thank you JW :^)
Great screencasts, Jeff! I didn’t know about CI before you started with these tutorials. I’m definitely going to use the framework in my current and future web projects.
A couple of things though; Could you provide a list with planned screencasts, like what topics and when you are going to cover them? And also, could you please bump secure login (with salts and sha1, user levels, the whole pack) up on that list? ;)
I’m really looking forward to the next screencast, keep ‘em coming!
Great series please continue on..
can not wait for next one… JW
Jeffrey, is there a reason on why you’re not using shorthand PHP on the form_open() ?
thanks again.
i’ve learned a lot :)
Dear Jeffrey Way,
I am learning from your posts these are very good for new students like me… Please share a post for Login Form with Validation on CI Framework.
Thanks for the tutorial, Jeff. Any chance you share with us your Dreamweaver Coloring Scheme? It’s a dark one with brown tones… you used it here: http://net.tutsplus.com/videos/screencasts/easy-development-with-codeigniter/
It’s an XML file (Colors.xml) in Documents and Settings\<user\Application Data\Adobe\Dreamweaver CS4\en_US\Configuration\CodeColoring
Thanks in advance :)
Jeffrey,
Loving these videos. Constantly refreshing my iTunes podcasts window in the middle of the week to check for updates to the series.
Please please please keep up the good work.
Thanks so much.
hello people i want to thank Jeffry Way, elliot and the tuts plus team for there screencasts here…..
I was a newbie to CI and this week I will be launching my first ever project(a travel site) totally based on codeigniter…
I’m just loving it… Thanx people…
follow me on twitter http://www.twitter.com/bluepicaso
Hey jeffrey,
The last 3 tutorials were great. But this one doesn’t seem to work for me :(
It just shows the loading animation, even though the whole thing has finished loading. I’ve tried it in several different browsers.
Can you put up a download link of the video? It just doesn’t seem to work for me.
Anyways, the last 3 were great. Thanks alot. Keep up the good work!
Where is day 5? :( Cann’t wait :(
Definitely Thursday, or Friday!
Great! Can’t wait! :-)
Can’t wait for day 5!!!
Dude your killing me whens the next one!!
Waiting…..
Loving them obviously!!!
Purely amazing. I did not know that code igniter comes with such a powerful form validation class. This is awesome, thank you so much for taking the time to explain this to us. I feel like I have a good grasp on this framework now, with all that you have taught us in just 4 screencasts. The 5th one is next, cant wait!
Video won’t play. Been trying for 2 days now.
How strange. I just added a link below the video where you can watch it directly at Blip.tv.
Thanks from Brazil!
I’m learning so much!
I love you man!
Thanks for Hong Kong
I loving you….you re the bst
The day 3 and 4 of this series had a very good timing in my project.Thanks Jeff.You’re doing a great job