After numerous requests, today we are launching a new screencast series on Nettuts+ that will focus exclusively on the CodeIgniter PHP framework. Over the course of about 10 videos, I’ll teach you exactly how to use this framework. Ultimately, we’ll work our way up to building a custom CMS. Without further ado, here’s day one!
Day 1
- Follow us on Twitter, or subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.


The tutorial works fine. Just use the new CI classes as noted above and double check the code. It does work.
I can’t see any video .
I was having the same issue on my system, so I asked my network administrator to allow http://blip.tv website in network firewall. Now I can see all the videos on my PC.
Hi;
Your videos in this series is not working. Just a blank screen. Firefox, Chrome, Opera..
Please get this fixed. I’m paying 9 bucks a month !
Thanks !
KP
It’s working fine, if you’d read the comment just above yours it would tell you what to do to get it working, reading is a great thing.
u cant read
In codeigniter 2.0.3 you have to use something like:
class Site extends CI_Controller{
}
class Site_model extends CI_Model{
}
But still, this is a great tutorial!
When something it doesn’t work as in the tutorial, you can find out why it’s not working on codeigniter.com.
Tip for “complainers”: Google more. Comment less! :)
Thanks for the point
Saved hours of confusion. Thank you.
All of these tutorials are great, however with the ongoing change in the web development and coding world, are these videos still accurately relevant to the current state of Code Igniter?
Since CodeIgniter 2.0 Model, View and Controller is now named CI_Model, CI_View and CI_Controller. The author should add a notice in the blog post!
Прикольные обои)
beautiful helpfull!!!
Videos still don’t load, just blank screen. Tried everything, every browser, even the new CI classes didn’t work. Something wrong here. Someone posted .flv file, I’ll try that.
Thanks for this great tutorial. I’m new at CodeIgniter and though the documentation is great, I couldn’t find any decent video tutorials until this one.
However, I am having some difficulties as I am also learning POO at the same time. Primarily I am having a hard time understanding Arrays of Objects…
I cant see video – just a blank page. plz help
Its ok now. Thanks for the introductory tutorial.
Great introduction to CodeIgniter. I am looking forward to watching the rest of the series.
so i had to view the tutorial twice, laad made me laught twice ^^’
we have to use CI_Controller{} for the new codeigniter versions…
can anybody tell me if that CI is the folder name in this case, or its just new syntax?
No, it’s not name of folder. CI_ – new syntax
You just saved me I was wondering what I was doing wrong! Thank you!
Isn’t it against the concept of the MVC pattern to have the model access the database?
It is only the model that should talk to the db/ data source!
I am facing problems in running php on windows environment , can somebody help with that
I have installed WAMP which isnt opening up.
You must have kept IIS running…. Close the IIS from Control panel and then start the WAMP server
I get to 21.34 in the video where we are editing routes.php changing the default_controller from welcome to site, but when I do that and refresh the browser, I get an error:
Parse error: syntax error, unexpected ‘{‘ in H:\…\htdocs\CI\application\models\site_model.php on line 5
I’ve made a bunch of errors and overcome them so far, but since I followed this to the “T” and Jeffrey’s problem was only that he had “laad” instead of “load” in his code, I do not know what to do.
I would be grateful for any suggestions
P.S. I have appended model and controller to CI_Model and CI_Controller already, so that is not the problem.
This is the code for site_model that has the error:
YOUR CODE
<?php
class site_model extends CI_Model {
function getAll() {
$q = $this->db->get(‘test’);
if($q->num->rows() > 0 {
foreach ($q->result() as $row) {
$data[] = $row;
}
return $data;
}
}
}
You are missing a bracket to close off the if clause. Add a ) after the 0.
for anyone having trouble playing the video, i noticed it only works on firefox for some reason.
here is the url outside of nettuts
http://blip.tv/play/gcMVgZGVKAI.html
I’m getting a “NetworkError: 500 Internal Server Error – http://localhost:8888/read/” error in my firebug console every time I try to load the model I made…it doesn’t make sense.
Nevermind I got it. Put CI_Model in the model I made…would be nice to know what else is changing too I keep running into little issues.
great!
Awesome…. Thank you so much. It’s really so much Helpful. God Bless….. :)
I have same problem with TC
db->get(‘test’);
if($q->num_rows() >0){
foreach($q->result() as $row){
$data[]= $row;
}
return $data;
}
}
}
?>
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\wamp\www\blog\thetest\application\models\site_model.php on line 5
This is the code
db->get(‘test’);
if($q->num_rows() >0){
foreach($q->result() as $row){
$data[]= $row;
}
return $data;
}
}
}
?>
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\wamp\www\blog\thetest\application\models\site_model.php on line 5
db->get(‘test’);
if($q->num_rows() >0){
foreach($q->result() as $row){
$data[]= $row;
}
return $data;
}
}
}
?>
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\wamp\www\blog\thetest\application\models\site_model.php on line 5
hey that was a nice tutorial for a newbie… thanks for the tutorial
This looks like a great tutorial, but before I get started: I suppose these videos are also good when using CodeIgniter 2.10?
Thanks.
I’ve been reviewing codeigniter since yesterday and I am just a newbie. Thanks for the post! It makes me have clearer view of the framework. I’m going to continue on watching this series.
This tutorial series is spectacular!
Thank you very much!
Your Videos are awesome for starter….!!! :) thanks for postin this.
Everthing works fine until I type
Parse error: syntax error, unexpected T_ENDFOREACH in /Applications/XAMPP/xamppfiles/htdocs/ci/application/views/home.php on line 14
<?php foreach ($records as $row); ?>
<h1> <?php echo $row->title; ?> </h1>
<?php endforeach; ?>
You had:
($records as $row);
Should’ve had:
($records as $row):
otherwise the code seemed fine… try it again..
Plz help me to download the video
thank you
Excellent intro to codeigniter, but even better intro to MVC. There are very few good videos on this. Creating classes in both M and C confused the hell out of me – which should go where – type-of-thing, but the explanation at the end cleared it up. Big hand to Jeffrey Way. Twitching to get on with it, but I’ll need to watch the rest of the videos before I dig a hole big enough to bury myself. :)
thanks a bunch man! its really helping me out! thumbs up for you jeffery! :)
thanks for these tutorials.just finish my first video
This is a pretty old tutorial, desperately in need of being updated. I’m wondering why there aren’t more tutorials for CodeIgniter out there?
Great tutorial ! And to counter some of the people here saying that this is outdated :), most of the system is still the same. Except for some minor things like CI_Model and CI_Controller instead of Model and Controller you won’t have any difficulty with this introductory video.
Maybe a little hint ( since once of the main reasons to use codeigniter is to speed up development and to “beautify” your code.
The foreach right at the end can be shortened to the following :
title; ?>
no need to use the foreach closing tag :) it’ll only confuse people ( unless they’re coming from a vb.net background :p )
and apparently i forgot to put in brackets with my code snippet
title; ?>
How would you use get data from a relational data db? e.g. if we had a table for blog posters/user and a table for blog postings and we wanted to show all blog posts from a specific poster/user?
could this be done via active record or would it have to be a specific model built for the one query?
i keep geting a 404 mesage!! i cant access a welcome controller and all but if i a want access a index function in site controller i get a 404! why? if a change default route to ‘site’ it works … i am using linux with LAMP
result() as $row) : ?>
title; ?>
text; ?>
I cant get the database rows to echo out i checked my model it looks fine and the controller I have tried searching it but still new to CI but can’t get that fixed you think you can help.
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/home.php
Line Number: 12
This is the warning i am getting i for got to put the right snippets to my code
Nice Tutorial for a beginner in CodeIgniter. It helps me a lot in to start with CodeIgniter.
Amazing tutorial. I really thank you about this.
Is there any way I can download this video? I want to have it on my Android Phone and view it as and when I get time. Somehow this page doesn’t play the video properly in Android.
I love the long series on CI. I’m just getting started for now..
I’d LOOVE to see a YII tutorial. If possible.
Is anyone getting errors from home.php after following the tut? I’m not able to show the array or foreach out the data
Site Model
db->get(‘test’);
if($q->num_rows() > 0) {
foreach ($q->result() as $row)
{
$data[] = $row;
}
return $data;
}
}
}
Site
load->model(‘site_model’);
$data['$records'] = $this->site_model->getAll();
$this->load->view(‘home’, $data);
}
}
When input into home.php statements do not validate as well
use CI_Controller instead of controller
I can’t see anything. I’m using my iPad with latest release of the IOS. Can you fix this? Why don’t you just use YouTube for your videos?