Is there a convention on how these files are linked together and the directory structure? ie placing the links (require) of view and controller.php in the index like you do, or just link them all in the bootstrap. @15:48 / @16:45
Or is it just following the idea of MVC loosely and make it work?
@espheroz It's a paradigm where an application is divided into three parts: the model (business logic, think database access and authentication), the view (produces the output, think HTML) and the controller (takes user input, accesses the model and loads the view).
If used appropriately and properly, it can make code more maintainable, reusable and testable.
Very nice tutorial. This is the best set of tutorials i have seen. Could you make these video's downloadable so i can put them on my zune to watch on my breaks at work?
a really wonderful tutorial really... love it how u explain it but i think a better solution for the "parameter" problem in the bootstrap is call_user_func_array(array(&$controller,$url[1]), $restofurlarray); this was the way i did it since PHP was goin to OOP - what do you think of that solution ? regards and keep up the good work !
AWESOME and thanks!!!, this is great video for learning how to create a simple MVC. Please don't stop! All of your videos are helping me be a better programmer...
After entering the instructions in my .htaccess file my mvc directory disappears and when accessing my mvc index file via the the browser I get a forbidden access error.
Perhaps you can help me, everything is ok with .htaccess so when I put something like "/mvc/help" in the url I can read it on the main page but if I write "/mvc/index" I've got no errors but it's not catch by the $_GET['url'] and the echo is empty...
spent a half hour pulling out my hair trying to figure out why _construct wouldnt work before figuring out it has 2 underscores .... i.e " __construct" not "_construct"
Been looking for a good intro to MVC - have read a lot. You tutorial helped months of reading to suddenly make sense. Some people complain that you go too fast, but that is why there is a pause button and a scrubber (I had to use both so I could follow along and code with the video). I really appreciate you taking the time to do the tutorial and to share it with the community. Great stuff, now on to part two...
When I add this line to htaccess "RewriteCondy %{REQUEST_FILENAME}!-d"
I get this error:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Excellent - way better than the others I've seen. However, about half way through ,when the actual MVC Tricks started to come into play e.g. passing data into the views, etc, you just were still moving a bit too fast to follow how and why that works. Great job though!
Also, anyone has a good approach at making a nice template system? I have one of my own, but I would find it hard for people with no PHP knowledge, just CSS & HTML to create a function for every page they're naming different.
@FacepuncherBlog Currently I'm only using the Controller class, and a function for every file/page. What's good about this is that you can make another controller to handle, lets say user information, and use that class and its functions with that function for the file.
First of all I will appreciate to you for your tutorial. I actually have a little problem. I have exactly your tutorial as you have done. It is ok in my localhost but when I publish in ftp I haven't got any view:(
Could you please help me about the reason why it is not shown?
@telewizjatvl You could just add some more $_GET or $_REQUEST in the bootstrap so you could do it like: controller/method/param1/param2/param3/param4 etc... You also are still able to do controller/method?querystring=123
hey thank for the tutorial but i ran into some trouble
i'm using wamp server i did exactly what you did but it is not redirecting to index.php or appending the url.
i even configured and changed root directory to be where index is in the httdf conf file but still i get the error The requested URL /1/public/ddd was not found on this server.
this way you only get the real params, and this also handles if someone is bitching with multiple slashes. Also as i know ignoring $_GET completely is the standard in most of the frameworks.
ps: it may be a bit slower, than a simple explode, but imho its way better.
Very nice! You really cover a lot in a short amount of time...I'm finally beginning to understand the Front Controller pattern and the MVC architecture and this video has been a HUGE help. Is there any security risk by passing your methods and arguments in URLs?
@BopjoWebDesign The only methods that can be called in controllers are set to public. So from a security point of view, you could prevent all accidental access to any method by marking it protected or private.
Nice tutorial btw Netbeans 7.0 is out you can just download and install and it will ask you to port all Profiles config + the rest and 7.0 is alot faster i think so
Amazing! Thanks for doing great lessons, keep still. :) I'll be happy if you do for this lesson, it is to extend the capabilities of the framework. Such as working with databases (CRUD operations), sessions (storing database (this much you want!)).
@eracoon You can point every file to index.php some way without htaccess, but your url will look like index.php / controllername -- code igniter does this, i dont know how to do it without htaccess
Is there a convention on how these files are linked together and the directory structure? ie placing the links (require) of view and controller.php in the index like you do, or just link them all in the bootstrap. @15:48 / @16:45
Or is it just following the idea of MVC loosely and make it work?
djwave28 1 day ago
cant wait to doo this!
WH3NDUTYCALLS 5 days ago
@WH3NDUTYCALLS You shall become pro!
JREAMdesign 5 days ago
what is mvc? can anyone tell me?
espheroz 1 week ago
@espheroz It's a paradigm where an application is divided into three parts: the model (business logic, think database access and authentication), the view (produces the output, think HTML) and the controller (takes user input, accesses the model and loads the view).
If used appropriately and properly, it can make code more maintainable, reusable and testable.
MelvinSF 1 week ago
Very nice tutorial. This is the best set of tutorials i have seen. Could you make these video's downloadable so i can put them on my zune to watch on my breaks at work?
deathofthemagi 2 weeks ago in playlist Uploaded videos
At 9:50, you could just replace isset() with !empty() on line 12 instead of complicating.
ZelenoJabko 3 weeks ago
can anybody help me with this c:php/pear problem at 4:20
he doesn't get it?
bboybram 1 month ago
an awesome tutorial
htoshmatov 1 month ago
a really wonderful tutorial really... love it how u explain it but i think a better solution for the "parameter" problem in the bootstrap is call_user_func_array(array(&$controller,$url[1]), $restofurlarray); this was the way i did it since PHP was goin to OOP - what do you think of that solution ? regards and keep up the good work !
w4ndregal 1 month ago
AWESOME and thanks!!!, this is great video for learning how to create a simple MVC. Please don't stop! All of your videos are helping me be a better programmer...
trautwein101 1 month ago
After entering the instructions in my .htaccess file my mvc directory disappears and when accessing my mvc index file via the the browser I get a forbidden access error.
Anyone encountered a similar error?
spiksanders 1 month ago
@spiksanders Most likely you have an error in your code, also check to make sure that you do have htaccess available and loaded in your server.
xlordtk 1 month ago in playlist Favorite videos
This is really a great tutorial. It helped me and I learned a lot. I'll watch more of your other tutorials. I'm hoping to know more about MVC :D
evilsky212 2 months ago
Really good. A lot of useful information.
pn8830 2 months ago in playlist PHP
I have wached all 6 parts are great, Thanks.
zlatkogv 2 months ago
Thanks full excellent tutorial
sagaht15 2 months ago in playlist PHP OOP Tutorials
Hi, thank you for this great tutorial!
Perhaps you can help me, everything is ok with .htaccess so when I put something like "/mvc/help" in the url I can read it on the main page but if I write "/mvc/index" I've got no errors but it's not catch by the $_GET['url'] and the echo is empty...
Hope I did explain it right, cheers
45M0D3E 2 months ago
spent a half hour pulling out my hair trying to figure out why _construct wouldnt work before figuring out it has 2 underscores .... i.e " __construct" not "_construct"
FFWDEntertainment 2 months ago
Comment removed
FFWDEntertainment 2 months ago
you're awesome!
JoeW789 3 months ago
ok,you explain lots about making a controller but you don't really explain why we would want to use an MVC
CPTDJB 3 months ago
Been looking for a good intro to MVC - have read a lot. You tutorial helped months of reading to suddenly make sense. Some people complain that you go too fast, but that is why there is a pause button and a scrubber (I had to use both so I could follow along and code with the video). I really appreciate you taking the time to do the tutorial and to share it with the community. Great stuff, now on to part two...
ApeWare 3 months ago 2
the tutorial was a bit too fast. but thanks for your time. im gonna watch it over and over again until it clicks lol
sarmenhb 3 months ago
Thanks so much you are a real awesome help
rayaddidas 4 months ago
Thank you so much for this tutorial! It was a great pleasure to watch it! You are an excellent teacher! Thank you!!! :))))
yesnikita 4 months ago 14
@yesnikita Thanks glad to help :D
JREAMdesign 4 months ago
Hi,
i think it would have been better if you did this without mod_rewrite, although it wouldn't change that much.
Thanks still a nice tutorial.
SamirAbuLina 4 months ago
When I add this line to htaccess "RewriteCondy %{REQUEST_FILENAME}!-d"
I get this error:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
puaflatmates 4 months ago
@puaflatmates
Thank you I found it dont worry, I was adding y at the end of cond.
Questions though:
I get the concept and makes good sense, what I am very unfamiliar with is the things you do in htaccess.
What do u recommend to read on htaccess and php ini modification?
Cheers
puaflatmates 4 months ago
@puaflatmates you wrote "RewriteCondy" it's suppose to be RewriteCond %{REQUEST_FILENAME} !-d
pwntastic2000 3 months ago
Man you are the best !
gps6167 4 months ago
This has been flagged as spam show
question about class auto-loading
too much for this space - so if you could take a look at code here: sites.google.com/site/jp7691/
Is this a good idea, or a short way to huge overhead (esp. on bigger projects)
jeffz2010 5 months ago
come and join online photoclub. fr. ht
monline08 5 months ago
7:10 LOL! I did the same exact thing, and I wasn't even copying you.
frosty1433 5 months ago
MVC pattern was way over my head until i find your video. Thank you, Sir!
gyuriFORhire 6 months ago 13
Comment removed
lordyrich 6 months ago
Excellent - way better than the others I've seen. However, about half way through ,when the actual MVC Tricks started to come into play e.g. passing data into the views, etc, you just were still moving a bit too fast to follow how and why that works. Great job though!
Chaos7703 6 months ago
Also, anyone has a good approach at making a nice template system? I have one of my own, but I would find it hard for people with no PHP knowledge, just CSS & HTML to create a function for every page they're naming different.
Anyone?
TheManuelFP 6 months ago in playlist PHP OOP Tutorials
@FacepuncherBlog Currently I'm only using the Controller class, and a function for every file/page. What's good about this is that you can make another controller to handle, lets say user information, and use that class and its functions with that function for the file.
It's more easier IMHO.
TheManuelFP 6 months ago in playlist PHP OOP Tutorials
@TheManuelFP
How do you do it? Seems much easier to keep things organized this way but always interested in other approaches...
FacepuncherBlog 6 months ago
I hate how you do a class for every file, so ugly.
TheManuelFP 6 months ago
Dear Sir,
First of all I will appreciate to you for your tutorial. I actually have a little problem. I have exactly your tutorial as you have done. It is ok in my localhost but when I publish in ftp I haven't got any view:(
Could you please help me about the reason why it is not shown?
Thanks and kind regards,
Arzu
arzuerdem 6 months ago
Cool thing :) Thanks for the tutorial !
conradkvideos 6 months ago
@telewizjatvl You could just add some more $_GET or $_REQUEST in the bootstrap so you could do it like: controller/method/param1/param2/param3/param4 etc... You also are still able to do controller/method?querystring=123
JREAMdesign 7 months ago
Comment removed
sporkeh90 7 months ago
Your tuts are the best m8 ;) Thanks for very good tutorials :)
DamianProgrammerPL 7 months ago
It's possible to do LFI
m0gria 7 months ago
almost very neat :D
iknow66615 7 months ago
Very instructive! Thanks!
SamyFOM 7 months ago
Good job, I like the ENTER, ENTER :)
flakerimi 7 months ago
hey thank for the tutorial but i ran into some trouble
i'm using wamp server i did exactly what you did but it is not redirecting to index.php or appending the url.
i even configured and changed root directory to be where index is in the httdf conf file but still i get the error The requested URL /1/public/ddd was not found on this server.
ymalklk 8 months ago
You didn't tell us what's the use of every code..
please make your tutorials more precise..
eminemchu43 8 months ago
@eminemchu43 This assumes you understand some PHP basics, I can't explain everything in every detail or the tutorials will be way too long.
JREAMdesign 8 months ago 30
@JREAMdesign workspace/mvc/../index lol
frosty1433 5 months ago
Also can you please put a direct link to where I can download this framework, I was on your website but couldn't really find it. Thanks
javavideocenter 8 months ago
Very good vide, but you lose me at 17.16
How can you just write $this->view = new View();
Do you not need to actually have a variable called $view?
Please respond or link to a nice website or video that will explain this form me, because it really got me puzzled.
Thanks
javavideocenter 8 months ago
@javavideocenter he declared the $this->view var in the baseController. You should look at libs/Controller.php
greg0ry92 7 months ago
This is a god send. Infinitely help, thanks much!
coolcarlrox 9 months ago
Nice. Very helpful. :)
Squidylad 9 months ago
how can i include view multiple times in a page?
biswarupadhikari 9 months ago
@biswarupadhikari Do it through the actual view template file.
JREAMdesign 9 months ago
Instead of triming, and exploding you can use, what i do in my own MVC:
$uriArray = preg_split('/\//', $_SERVER['REQUEST_URI'], -1, PREG_SPLIT_NO_EMPTY);
this way you only get the real params, and this also handles if someone is bitching with multiple slashes. Also as i know ignoring $_GET completely is the standard in most of the frameworks.
ps: it may be a bit slower, than a simple explode, but imho its way better.
noherczeg 9 months ago
@noherczeg good call!
JREAMdesign 9 months ago
That's awesome..
I like the way did this...
Keep up the good work..
nargetey 9 months ago
@nargetey thanks -- part 2 coming in a few hours :)
JREAMdesign 9 months ago
Well done! This is a great primer to get a head start in understanding MVC design patterns. Hands-on is the way to go in my opinion!
rmnanney 9 months ago
Very nice! You really cover a lot in a short amount of time...I'm finally beginning to understand the Front Controller pattern and the MVC architecture and this video has been a HUGE help. Is there any security risk by passing your methods and arguments in URLs?
BopjoWebDesign 10 months ago
@BopjoWebDesign The only methods that can be called in controllers are set to public. So from a security point of view, you could prevent all accidental access to any method by marking it protected or private.
JREAMdesign 10 months ago
@Fonqie What do you mean by security validation? Validating form input? Or do you mean something else?
JREAMdesign 10 months ago
Nice tutorial btw Netbeans 7.0 is out you can just download and install and it will ask you to port all Profiles config + the rest and 7.0 is alot faster i think so
Bassaddicted 10 months ago
@Bassaddicted Awesome great news!!!! Its finally out of beta :D
JREAMdesign 10 months ago
@JREAMdesign Yes sir :) lol
Bassaddicted 10 months ago
Thanks so much for this video ! This is awesome :D
ashboxtoo 10 months ago
Amazing! Thanks for doing great lessons, keep still. :) I'll be happy if you do for this lesson, it is to extend the capabilities of the framework. Such as working with databases (CRUD operations), sessions (storing database (this much you want!)).
nasisof 10 months ago
@nasisof Im surprised you sat through the whole thing haha
JREAMdesign 10 months ago
Awesome Tutorial
Telmomarquse 10 months ago
wanted to recreate this tutorial...
But I dont use Apache. I have cherokee... which does not support .htaccess files.
Is there a way to do without rewrites... or to handle the url thru php so I could implement this mvc everywhere?
great tutorial by the way... very clear
eracoon 10 months ago
@eracoon You can point every file to index.php some way without htaccess, but your url will look like index.php / controllername -- code igniter does this, i dont know how to do it without htaccess
JREAMdesign 10 months ago
Great tutorial! Many thanks.
QuadRaxiX 10 months ago
@QuadRaxiX Sure, I forgot who requested so i tried to make it
JREAMdesign 10 months ago