PHP MVC Framework from scratch | Source code included | Quick programming tutorial

  Рет қаралды 101,798

Quick Programming

Quick Programming

Күн бұрын

Пікірлер
@faisalasif5986
@faisalasif5986 Жыл бұрын
This course is competing all paid courses .. i am happy to find you in mybest youtube tutor. Love you.
@QuickProgramming
@QuickProgramming Жыл бұрын
Wow, thanks :)) am happy to hear it
@HolisticFX-f2z
@HolisticFX-f2z 7 ай бұрын
​@@QuickProgramming I completely agree also. but if you get chance to comment on my post that would be greatly appreciated.
@jhalmu
@jhalmu Жыл бұрын
Please people do not use this in World Wide Web before you know how to encrypt yor password. NO unencrypted passwords to database. Author should remember to say that to you. Be safe. Very nice tutorial, learned much.
@shaikhanuman8012
@shaikhanuman8012 Жыл бұрын
PHP MVC best course, clear explanation on how MVC pattern works.
@QuickProgramming
@QuickProgramming Жыл бұрын
Awesome, thanks for the feedback 😊
@utac
@utac 28 күн бұрын
Dude is absolutely killing it over here
@Wongmc644
@Wongmc644 Жыл бұрын
Watched 15 min and the explanations n flow is superb. Just great tutorial! Thanks
@basilistigris640
@basilistigris640 Жыл бұрын
thank you Quick Programing for php mvc from scratch videos is the best to learn php javascript and web development! Great teacher explaining all functionalities and provide the code of the lesson!
@QuickProgramming
@QuickProgramming Жыл бұрын
thank you :)
@DR9Freelancer
@DR9Freelancer 8 ай бұрын
Fantastic tutorial! If someone wants to learn mvc, i recomend to start from this video! Very well explained!!! Well done to the author!!!
@QuickProgramming
@QuickProgramming 8 ай бұрын
Thanks so much. I really appreciate your recommendation 😊
@DR9Freelancer
@DR9Freelancer 8 ай бұрын
@@QuickProgramming keep doing what you doing! Thank you so much for sharing your knowledge with us! Cant wait to see more tutorials from you!!!
@enriquesalomon8197
@enriquesalomon8197 10 ай бұрын
SALUTE to this , best tutorial I've ever seen in all PHP tutorial. well explain.
@QuickProgramming
@QuickProgramming 10 ай бұрын
Thank you, I appreciate your compliment and feedback 😊
@user-rx8lz6yz4f
@user-rx8lz6yz4f 4 ай бұрын
This is really great explaining and demonstrating. I understand much better how the models and queries are wired up now in an MVC / ORM. Really appreciate the work you put in to this.
@premruetaiseeplak1758
@premruetaiseeplak1758 Жыл бұрын
This is from scratch that I looking for! thank you very much.
@QuickProgramming
@QuickProgramming Жыл бұрын
You're most welcome 😊
@gru8299
@gru8299 Жыл бұрын
Thank you very much for the lesson! Surprisingly, after watching a couple of videos on the same topic in my native language, I understood more from you! Watching and delving into the subtitles.
@QuickProgramming
@QuickProgramming Жыл бұрын
Am very happy to hear it and thanks for leaving some feedback😊
@melvinreano1221
@melvinreano1221 Жыл бұрын
Great video!! it helps alot specially those aspirant PHP devs
@Lucianno888
@Lucianno888 Жыл бұрын
You are the best teacher i ever meet!
@avan4197
@avan4197 5 ай бұрын
Hi. This is a wonderful tutorial. If instead of writing all the PHP code at once, it would be great if HTML was developed along with it. Like if after creating the MVC structure, it was started from the HTML home page and all the changes related to login (necessary PHP on this page) were made. And then if any changes were required on the login html page they would be done there. And then the PHP code that needed to be written would be written by connecting the logging or home controller to it. And then gradually the complex code would be added, sequentially. Namespaces, triators and extra functionalities, such as validation rules, requests, posts etc, make this tutorial complex. It is quite difficult for beginners but probably intermediate learners will also find it difficult.
@jasonwilliams199
@jasonwilliams199 Жыл бұрын
Great work. This OOP construct is awesome. I'll be watching your series on php photo gallery website next to learn how to implement the MVC Framework into a bigger project.
@shubh-kr
@shubh-kr 2 жыл бұрын
It's very good and clearly explained. It's great for any php/MVC novice. Great job.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thank you very much!
@shubh-kr
@shubh-kr 2 жыл бұрын
@@QuickProgramming Wait and in some time you'll be another freeCodeCamp specific to PHP :) PHP will thank you.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
@@shubh-kr thank you, i really appreciate the vote of confidence🙂
@muhammadnaveed7953
@muhammadnaveed7953 2 жыл бұрын
Awesome job. Thank you bro. You are putting quality content on this channel.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thanks, I appreciate it!
@CountryVlog
@CountryVlog Жыл бұрын
Atlast found the perfect solution. Thanks brother
@QuickProgramming
@QuickProgramming Жыл бұрын
Happy to help! am glad you found it useful. Dont forget to also check the update where i added more functionality here kzbin.info/www/bejne/rpipgYOKbJKCp68
@Im.ManjeetSingh5
@Im.ManjeetSingh5 Жыл бұрын
Watched other youtbers video but your videos are well explained and understandable for me. Keep up the good work❤
@QuickProgramming
@QuickProgramming Жыл бұрын
Thanks a lot for the feedback😊
@neilmckenna1742
@neilmckenna1742 7 ай бұрын
Awesome Tutorial, definitely helped me understand PHP MVC.
@QuickProgramming
@QuickProgramming 7 ай бұрын
Thats awesome to hear
@DanielMontezima
@DanielMontezima Жыл бұрын
Thank you for this tutorial. Amazing! I liked, commented and subscribed!
@QuickProgramming
@QuickProgramming Жыл бұрын
Thanks for taking time to leave some feedback and also subscribing😊
@serversus17
@serversus17 Жыл бұрын
I implemented a router for the framework by modifying the app class and creating a router.php file. This was done because the app I am developing was becoming complex. I’d like to share my implementation and I hope you’ll do a tutorial for that soon. Keep up the good work 🎉
@QuickProgramming
@QuickProgramming Жыл бұрын
its good you're able to come up with your own implementation, that means you're actually learning and improving. There are many ways to implement the router so as long as it works as you need it, that awesome!
@portaldocodigo
@portaldocodigo Жыл бұрын
I'm waiting for your sharing, it could be very important for me.
@MewtwoStar
@MewtwoStar 7 ай бұрын
@@QuickProgramming can you add router to this MVC framework, it will be very helpful for all type of projects. thank you.
@janedawg09
@janedawg09 11 ай бұрын
great content. you're teaching's really good. appreciate the zoom in/out, makes it easy to follow along and copy the codes afterwards. wanted to finish this in one go but got stuck for 2 days due to my assets files not being read. in case anyone come across the same problem where they can't load css/images/js just add the line before the last line in htaccess shown in the video: RewriteCond %{REQUEST_URI} !\.(css|jpg|jpeg|png|gif|ico)$ [NC]
@QuickProgramming
@QuickProgramming 11 ай бұрын
Youre most welcome and thanks for that HTACCESS tip, i'll test it out as well :)
@Lucianno888
@Lucianno888 Жыл бұрын
thank you and good luck with your projects!
@AsmaKhan-qf6gd
@AsmaKhan-qf6gd Жыл бұрын
well I love your way of teaching and I Got it 100% thank you so muchhhhhhhhhh
@abdulquadri6130
@abdulquadri6130 2 жыл бұрын
Fantastic, I really want this . Can not wait to watch this. Your your teachings are so great and the impacts it has created in me as a php developer is wonderful. keep it up man. Thank you Quick Programming.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
awesome, am glad to hear it
@GerritforBazeja
@GerritforBazeja 11 ай бұрын
Thank you very much for sharing your video-lesson. Esspecialy the way your handeling it. step by step makes it very understandeble
@benkleph
@benkleph 2 жыл бұрын
this is awesome. have learnt a lot from your tuts
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Great to hear!
@majidsamir7657
@majidsamir7657 Жыл бұрын
Your teachings are so great thank you very much , Keep going you are the best
@QuickProgramming
@QuickProgramming Жыл бұрын
Thanks, i appreciate
@phpcoderforever
@phpcoderforever Жыл бұрын
you are the best teacher thanks
@cesaresqueda3108
@cesaresqueda3108 2 жыл бұрын
maravilloso aporte gracias, saludos desde venezuela...
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thank you, greetings to you too :)
@elbromas12459
@elbromas12459 Жыл бұрын
You are Best, thanks for all course
@QuickProgramming
@QuickProgramming Жыл бұрын
You're most welcome and thanks for your awesome feedback😊
@GRCG
@GRCG Жыл бұрын
Love it, but I would like to see how you can add in this MVC a shopping page and cart that is connected with a database and handle it from out the admin. I'm new in this and want to learn more on how you can build up from out that base MVC. Product must contain size, color and so on, because when you search for a shopping page with check out nobody use these settings during when you want to buy something you pick your size and color
@benalidounia
@benalidounia Жыл бұрын
thank you for this great tutorial !!
@HuyTran-cl6ny
@HuyTran-cl6ny Жыл бұрын
From VietNam with Love ❤❤
@QuickProgramming
@QuickProgramming Жыл бұрын
Awesome!
@helloholahi
@helloholahi Жыл бұрын
i didn't finish the video yet, but just, at 20:12 it's a bad idea to indicate the directory of your admin files in here, in terms of security, because it makes it very easy for hackers to know where to search for your backoffice! you can instead: - ask google not to index these pages from google search central - add php headers at the beginning of your files: header("X-Robots-Tag: noindex", true); - add a meta tag in your html:
@QuickProgramming
@QuickProgramming Жыл бұрын
That's not the real admin folder. There will be no such folder on the website. All links are simply mod rewrites and not real folders
@phpstudy8625
@phpstudy8625 2 жыл бұрын
Great job BRO , you are the Best !!!
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thanks a lot!
@rimantasdanilevicius6754
@rimantasdanilevicius6754 Жыл бұрын
Fresh stuff on youtube! Thanks! Question - can this MVC used in production?
@QuickProgramming
@QuickProgramming Жыл бұрын
yes it can. Thats what i use in my own projects, ofcourse with a few added features but no major differences
@rimantasdanilevicius6754
@rimantasdanilevicius6754 Жыл бұрын
@@QuickProgramming Bro, I was looking such video sine 2017! Thank you for confirmation. Now it time to get hands dirty! I SUBSCRIBE!
@zorahypatia
@zorahypatia Жыл бұрын
Thanks bro you are safe my life
@QuickProgramming
@QuickProgramming Жыл бұрын
you're most welcome
@martebest
@martebest Жыл бұрын
Great tutorial. Very well explained. Thanks a million. :)
@manjonex
@manjonex Жыл бұрын
Thank you for the lesson , please trying to impliment a website that has admin , how do i arrange the folders and controllers
@jaynoscap
@jaynoscap 9 ай бұрын
Thanks for this tutorial It helps me a lot well explained and solid❤
@tylerflaviano2023
@tylerflaviano2023 Жыл бұрын
always the best teacher
@QuickProgramming
@QuickProgramming Жыл бұрын
Thank you :)
@anmarm.9487
@anmarm.9487 2 жыл бұрын
Thank you for the awesome tutorial. a suggestions, add Request and Response Class, then a simple validation class, You will have a beautiful MVC framework that work as a base for all small websites and APIs hence Response Class. Nevertheless, Great tutorial.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thanks for the suggestions. i'll be making a follow up tutorial to add more functionality soon. a request class and validation class will be included and a few more classes to speed things up
@kushkumarsoni3654
@kushkumarsoni3654 2 жыл бұрын
Awesome content sir ..plz create a playlist for creating own php MVC framework
@QuickProgramming
@QuickProgramming 2 жыл бұрын
i'll be using this same framework to make alot of tutorials on converting templates to working websites, so yes there'll be a playlist🙂
@saharghasemi-h9k
@saharghasemi-h9k Ай бұрын
Thank you, It's really good
@mingming1869
@mingming1869 7 ай бұрын
❤Thankyou! gonna do my capstone
@__-bk6mm
@__-bk6mm Жыл бұрын
This is amazing! Could you do a video showing how to convert the social media project to this structure?
@QuickProgramming
@QuickProgramming Жыл бұрын
i used this framework to make a simple social website here kzbin.info/www/bejne/fqTTmZJjZqqVhqM
@KoJIJoky
@KoJIJoky 9 ай бұрын
Awesome course, thanks a lot
@jhon.k.3227
@jhon.k.3227 Жыл бұрын
Thanks for the video, you are a great teacher, can I ask if it's possible to send data with Ajax from login page to controller Login in this MVC ? I have tried, but failed.
@QuickProgramming
@QuickProgramming Жыл бұрын
sure its possible. the code below will send data to the controller of whatever page you're on. let xhr = new XMLHttpRequest(); xhr.addEventListener('readystatechange',function(e){ if(xhr.readyState == 4 && xhr.status == 200) { alert(xhr.responseText); } }); xhr.open('post','',true); xhr.send(); to send to a specific controller, add the full path to that controller in the open part like this: xhr.open('post','/home',true); ROOT represents the absolute http path to your project, e.g localhost/mvc/public
@jhon.k.3227
@jhon.k.3227 Жыл бұрын
@@QuickProgramming I get a way to pass the ajax Post variables to the controller page, however, when trying to instant the Class I receive a error: Class "Login" not found in C: \xampp\htdocs\MVC\app\controllers\Login.php:12
@abdokhaled4488
@abdokhaled4488 2 жыл бұрын
i am so excited for the course can you make course about lumen microframework
@QuickProgramming
@QuickProgramming 2 жыл бұрын
I'll check it out
@TheAdamsalam
@TheAdamsalam Жыл бұрын
Thanks for these great tutorials, I believe you are one of the best on youtube. Do you have an Udemy channel, please? just for follow on complete production applications.
@youaskforit
@youaskforit Жыл бұрын
The routing is fine but it is how Codeigniter does it. Laravel does it differently and is more robust cause you can clearly define the request method and map the appropriate controller method. With codeigniter example your can’t tell if its a get, post, patch etc without doing additional check. Anyway, it’s good if you are just beginner learning how it works as this is one way to do it.
@QuickProgramming
@QuickProgramming Жыл бұрын
in this you can also specify the method because the second item is the method, e.g in this link, 'edit' is the method 'website.com/product/edit'. laravel is too complex for no reason. code igniter is slightly less complex, so i prefer it. Sure laravel can specify if its a GET or POST request but whats the real world application of that? it just creates a lot of 'page not found' scenarios. better to check using the request class or server method. The complexity of laravel is what i try to avoid by creating my own framework. if i copy laravel exactly then its better i just use laravel because it already exists. i could save time. in the end its all about preference i guess, i prefer making things myself, that way am not lost when a clients wants to change anything
@chronicleofgreatness121
@chronicleofgreatness121 2 жыл бұрын
Great teacher of our time on KZbin, Please can we have this tutorial for download letter, i need it so i can be practicing it when am offline
@QuickProgramming
@QuickProgramming 2 жыл бұрын
thanks, i think using the youtube app you can download for offline viewing
@chronicleofgreatness121
@chronicleofgreatness121 2 жыл бұрын
@@QuickProgramming Thanks, I have downloaded it for offline view. More grace.
@3bdofocus761
@3bdofocus761 2 жыл бұрын
hello quick i need your advice i have learned [ html - css - php - mysql - basics of ajax - api - laravel ] what aslo i need to learn to be backend developer and i am junior by the way and what is the next steps to be pro from your opinion ❤❤❤❤
@QuickProgramming
@QuickProgramming 2 жыл бұрын
to become a pro, learn OOP. after that, all you need is actual experience. start building actual websites. ask people who need websites if you can build them one for free. even friends and family if possible. the experience you get from it is invaluable. you can then use those same websites as part of your portfolio when looking for work. people care more about your work experience
@wayneshen5201
@wayneshen5201 2 жыл бұрын
Good job sir
@QuickProgramming
@QuickProgramming 2 жыл бұрын
Thanks :)
@lawrencenoah9511
@lawrencenoah9511 11 ай бұрын
Nice tutorial
@akordeonista
@akordeonista Жыл бұрын
Hello Eathorne, There is one thing I dont understand about model. When we execute the statement we give a array to execute() function. And now: For example the prepaired query is: SELECT * FROM users where id = :id for execution we give information that [ 'id' =>4] - there is no expressions ":id" (with a colon). How does the computer know that it should associate ":id" with "id"? W bindValue we should use (':id' , $x =4)...
@QuickProgramming
@QuickProgramming Жыл бұрын
the keys of the array must match the keys in the array. in this case the :id will be mapped to 'id' in the array
@akordeonista
@akordeonista Жыл бұрын
@@QuickProgramming Unfortunately, I still don't understand :( does this mean that the computer will look for the most similar key? It doesn't have to be identical? Does prefixing the key with a colon have any meaning here?
@QuickProgramming
@QuickProgramming Жыл бұрын
@@akordeonista the colon is there to tell PDO that the text is a variable to be taken from the array. without the colon it wont look in the array
@akordeonista
@akordeonista Жыл бұрын
@@QuickProgramming OK, thats clear, thank you
@liviubarburo
@liviubarburo 2 жыл бұрын
Very nice. When is next video using this mvc?
@QuickProgramming
@QuickProgramming 2 жыл бұрын
i'll be making a lot of websites using this framework, and we'll improve it over time to speed production times. there will be lots to learn from it
@clavikLeniv
@clavikLeniv Жыл бұрын
Дякую!!!! Gracias!!! THANK you very mach!
@QuickProgramming
@QuickProgramming Жыл бұрын
You're most welcome 😊😊
@envadd.6556
@envadd.6556 Жыл бұрын
You are the best teacher when it comes to coding for sure!! I was wondering how would we go about templating when we have the same header and footer used on all pages without copying them on every page... Where would we use them? Would it be the index page, or would we create something else that gets pulled before and after each view?
@QuickProgramming
@QuickProgramming Жыл бұрын
thanks. you can load any view file, including the header if you save it as a separate file and then load it the same way you load other view files inside another view, e.g $this->view('header'); i made a simple social website using this framework here. you can get some ideas from there. this is a link to all related videos, but you can just watch the one with the social website for your issue. kzbin.info/www/bejne/fqTTmZJjZqqVhqM&pp=gAQBiAQB
@envadd.6556
@envadd.6556 Жыл бұрын
@@QuickProgramming Thank you for a prompt reply! - I am working on a platform and would like to use your MVC instead of procedural PHP as usual. Appreciate all your hard work, as I learn a lot from you!
@jworkman753
@jworkman753 4 ай бұрын
Since the protected variables were declared in the trait Model, how do you overwrite them when using the trait model in another model (my model) using trait Model? would you use the constructor? the variables must be the same as the trait, but I want to change the variables based on the table from the database I am querying? I hope that makes sense what I am asking.
@aoaxe
@aoaxe 3 ай бұрын
instant subscribe brother
@aravind_gowda
@aravind_gowda 2 жыл бұрын
Please build a news website with mvc and user can also create news content by registering .. and add districts states
@QuickProgramming
@QuickProgramming 2 жыл бұрын
alright, will work on that
@CivicYt
@CivicYt Жыл бұрын
You just want him to code the project for you? ;)
@__-bk6mm
@__-bk6mm Жыл бұрын
@@CivicYt I was thinking that as well, kinda came across as "make my website" lol
@MdRabby-tg2fh
@MdRabby-tg2fh 2 жыл бұрын
Amazing tutorial☺️☺️☺️,, can you make a wordpress plugin development course ?? 😐🤔🤔
@QuickProgramming
@QuickProgramming 2 жыл бұрын
thank you. i made one here to get you started kzbin.info/www/bejne/lX6mnaCOnr52idk
@MdRabby-tg2fh
@MdRabby-tg2fh 2 жыл бұрын
@@QuickProgramming This is theme development. What to make plugin development video in the future
@QuickProgramming
@QuickProgramming 2 жыл бұрын
@@MdRabby-tg2fh oh I see. It's not very different though. Plugins are just a smaller version of themes. But I'll make one soon
@MdRabby-tg2fh
@MdRabby-tg2fh 2 жыл бұрын
@@QuickProgramming i am waiting for your video
@HolisticFX-f2z
@HolisticFX-f2z 7 ай бұрын
Hi, I find this tutorial absolutely priceless. It's got my thumbs up! (see my reply below. it was an easy fix due to my error) Everything worked out fine until I got to 2 hours and 7 mins. It's definitely not a criticism but I have to point out that the return query doesn't work for me, it throws an error. This is the error message. Fatal error: Uncaught Error: Call to undefined method Model::query(). I'm pretty newbie so I am not sure why you don't get the error but I do. I have checked the syntax line by line and it's identical and it ran fine up to the echo() of the query, but not with the code changes that followed including the return of the query. Any input would be appreciated.
@HolisticFX-f2z
@HolisticFX-f2z 7 ай бұрын
​ @QuickProgramming if you get chance to comment on my post that would be greatly appreciated.
@QuickProgramming
@QuickProgramming 7 ай бұрын
the error is saying you dont have a function called 'query' in your model class. This could be because you're not including or extending the database class inside your model. SO make sure you have the parts the 'extends database' in your model declaration. e.g class Model extends Database{ Or it could be a spelling error. Make sure the function in the database class is exactly named 'query' and not something else.
@HolisticFX-f2z
@HolisticFX-f2z 7 ай бұрын
​@@QuickProgramming since you gave you those suggestions it helped me question if I had done something wrong. I checked back over the video slowly from around 1 hour 40 mins. It turns out that at 1 hour 47 mins, because you cut and paste the function query() between the core files model.php and the database.php and back again, that I forgot to paste the public function query() back into Trait Database {} in database.php. It's definitely given me experience of understanding the code better. Thanks again for your time in giving me direction.
@QuickProgramming
@QuickProgramming 7 ай бұрын
@@HolisticFX-f2z you're most welcome. debugging experience is very important as it makes you a better programmer. Am glad you sorted it out :)
@HolisticFX-f2z
@HolisticFX-f2z 7 ай бұрын
@@QuickProgramming Thanks again.. debugging definitely draws my attention to the details. I suspect i'll continue to get more bugs as I continue to create errors in the syntax also :) I just wish I was at the same level of creativity as you and have knowledge of the functions like you do!
@mdazhardware
@mdazhardware 2 жыл бұрын
Thanks for this amazing tutorial, I was following your tutorial step by step but in 3:28:55 I got this message Warning: Array to string conversion in E:\xampp\htdocs\mvc\app\core\Model.php on line 70 which is [if (!in_array($key, "$this->allowedColumns")], any advice please? thanks in advance.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
do not put quotation marks around this part $this->allowedColumns. if you do that it tries to turn the array into a string, thats why its saying "Array to string conversion" in the error
@mdazhardware
@mdazhardware 2 жыл бұрын
@@QuickProgramming Thanks, that's right.
@akordeonista
@akordeonista Жыл бұрын
Hi Eathrone, Why do we use 'require' instead of 'include' in that case?
@QuickProgramming
@QuickProgramming Жыл бұрын
You use include if the file you want to include is optional. Include will throw a warning if the file is not found but the code will continue executing. When you use require, the code stops executing when the file is not found. It throws a fatal error. I prefer require in this case so the cod doesn't continue if the file inst found. You can use include if it suits your purpose better. It's just a matter of preference
@akordeonista
@akordeonista Жыл бұрын
@@QuickProgramming thanks a lot
@LennartW-p7b
@LennartW-p7b Жыл бұрын
Thanks for the guide. It's really very easy to understand, good work! I just have a question about the public directory. What is the best way to implement it so that it is no longer indicated in the URL? So that you only see your domain. Many thanks in advance!
@QuickProgramming
@QuickProgramming Жыл бұрын
the public folder never shows up on the live server. its just there to organise your files better on your local machine. on a live server, you will be given a public folder there as well to put your files. thats where you will add the files that are in your local public folder too
@LennartW-p7b
@LennartW-p7b Жыл бұрын
​@@QuickProgramming Ahh okay, thank you for your response! You said in your video that it is not possible to load JS files inside the app folder. Couldn't this be used within the view Pages: So the script is inserted as JS content within the head area. Maybe they is a better way to insert the JS file for each view page over the controller class? So you don't need to put the script tag on each view page.
@QuickProgramming
@QuickProgramming Жыл бұрын
@@LennartW-p7b yes you can load JS & CSS that way but its inefficient. the reason we load JS & CSS files using the tags is because a user's browser can store them locally. This means they only need to be loaded once on the first page load. This is known as caching. loading the js as part of the HTML adds bulk to the code being loaded on every request. furthermore, you cant do this for images since you can use the require or include on them. you'll still need to put them in the public folder. so why not just put your JS and CSS files in there too? i just dont see the point of trying to hide JS files when the user can still see the JS code no matter how its being loaded
@LennartW-p7b
@LennartW-p7b Жыл бұрын
@@QuickProgramming Thank you for your extensive answer! You are right that JS code is usually always used for client-side rendering. I understand why you used this folder structure for the software. My message does not aim to be more critical of this. I'm just testing what I can do with PHP and vanilla JS to make my JS code less readable. I already use techniques like obfuscation and minification. In the future I would like to further limit access to the code by running the code on the server and the client only holding the resulting HTML code. Like this example: Restricted Access Click me
@aymanalredi66
@aymanalredi66 Жыл бұрын
Hi sir, thanks for this tutorial! how do not allow duplicates when entering data in your insert method?
@QuickProgramming
@QuickProgramming Жыл бұрын
you can use data validation to avoid that. then run the insert method only after checking if values are unique. i made a tutorial on form validation here kzbin.info/www/bejne/r56znZWdr5t1pbc
@drkentcw
@drkentcw Жыл бұрын
thanks it was great. better to replace a silent keyboard and mouse, get prepared for the course. You have been copying/moving/making changes/forgot your code back-and-forth many times.
@QuickProgramming
@QuickProgramming Жыл бұрын
Am a busy person. I don't have the time to prepare for a course. I code in real time. The back and forth is important because it shows you how coding is like in the real world, rather than showing a perfect version which never happens in real life. However, there are plenty of shorter and well peppered videos online, so you don't have to watch mine
@rushinsandeepane2883
@rushinsandeepane2883 Жыл бұрын
Thank you sir
@QuickProgramming
@QuickProgramming Жыл бұрын
You're most welcome :)
@singlefocustechnology
@singlefocustechnology Жыл бұрын
Greetings to you my PHP hero, and greetings to everyone committed to this unique discussion thread. Please sir, can this MVC be used for public production???
@QuickProgramming
@QuickProgramming Жыл бұрын
yes it can
@singlefocustechnology
@singlefocustechnology Жыл бұрын
Thanks sir. Greetings to you my PHP hero. Please sir, could you do a tutorial for payment wallet using this MVC.
@ripon59
@ripon59 8 ай бұрын
Pure gem
@MinhazTaher
@MinhazTaher Жыл бұрын
i want to write SELECT * FROM users WHERE id = 1 id != 2. How can i modifiy where method inside model class ? its not working when i pass $model->where([id=1],[id=2]). Because array_marge replace delicate key. video Timeline 2:07:23
@QuickProgramming
@QuickProgramming Жыл бұрын
i think you forgot the '&&' like this: SELECT * FROM users WHERE id = 1 && id != 2. but this query doesnt make much sense because if id is 1 then its not 2, this means there is no need for the last part of the query which says 'id != 2'
@MinhazTaher
@MinhazTaher Жыл бұрын
@@QuickProgramming Thanks for the reply. Really appreciate. actually, i try to build SQL with an "OR" operation like you. like SELECT * FROM users WHERE name = 'A' or name = 'B". $data_or = ['name' => 'A', 'name'=>'B'] $data_or showing only ['name'=>' B'] as an associative array can not contain duplicate key. any idea how to build this SQL like you? so far my code if (!empty($dataOr) && isset($dataOr)) { $this->sql .= '('; foreach ($dataOr as $key => $value) { $this->sql .= $key . ' = ? OR '; array_push($this->val, $value); } $this->sql = rtrim($this->sql, ' OR '); $this->sql .= ')';
@ilya_123__
@ilya_123__ 9 ай бұрын
thank you!!
@QuickProgramming
@QuickProgramming 9 ай бұрын
You're welcome!
@blufashionbd
@blufashionbd Ай бұрын
I'm grateful
@ПётрТатамович
@ПётрТатамович Жыл бұрын
Great tutorial. It really helps me. I really hate PHP, but in the same time I understand how cool is this language. Following this tutorial, it were many mistakes, and all of them was because I made mistakes in some name of variables (lost concentration I guess). Now I have an issue with inserting new user in the table. When I use show($_POST) it shows me the inputs, but freaking $user->insert($_POST) does not! What is the problem?
@ПётрТатамович
@ПётрТатамович Жыл бұрын
The problem is in terms actually. Accepting the terms is part of validate function. And after you put check mark to Accept the term it's value becomes the part of what you try to post. But there is no terms column in users table. If I remove accept the terms from validate function it works. But I don't understand why is it worked for you, man ?
@angngimasherpa7321
@angngimasherpa7321 2 жыл бұрын
you are a great teacher man thank you for the video. I have a query, How do i hide Index of page, can't i just show the main page without showing the app and model folder. Appreciate it.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
am not sure in understand the question. how does the app and model folder show when you're showing the main page?
@angngimasherpa7321
@angngimasherpa7321 2 жыл бұрын
@@QuickProgramming I mean when I enter the url "localhost/mvc" is there a way to hide app and public folder.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
@@angngimasherpa7321 on your local computer, i dont think its possible to hide any folders and if you hide or lock them, then your website wont be able to access them. so its not posible. why do you want the folders hidden?
@angngimasherpa7321
@angngimasherpa7321 2 жыл бұрын
@@QuickProgramming i am trying to host a demo website on 000webhost and I have to click on public to view the home page, I can't figure how do i just show main content directly.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
@@angngimasherpa7321 the public folder on your localhost represents the public_html folder online, so you're not supposed to have any public folder on your server. your app folder should be outside the public_html folder to keep the folder structure intact
@wahidamini7591
@wahidamini7591 2 жыл бұрын
Thank you so much, it's greate. A Question can you please name your controllers like HomeController or ProductController instade of Home and Product? Because we are lost always bettween models and controllers as the file has the same name. I tried to change but it takes an error.
@QuickProgramming
@QuickProgramming 2 жыл бұрын
there's a better solution with namespaces which we'll get to eventually
@__-bk6mm
@__-bk6mm Жыл бұрын
@@QuickProgramming ooo a teaser of things to come!
@Matex__
@Matex__ Жыл бұрын
whats the difference between first and get row methods?
@QuickProgramming
@QuickProgramming Жыл бұрын
good question. the get_row function is for running a query, first function uses an array instead. using the first function you dont need to specify a table or even type a query. but there are times when you need to run a complex query and need only one result, thats when you use the get_row function
@AsmaKhan-qf6gd
@AsmaKhan-qf6gd Жыл бұрын
can we use in production sir?
@sakmaestro3852
@sakmaestro3852 Жыл бұрын
Sir which do u prefer framework laravel, symfony or codeigniter?
@ابوأحمد-ث9ت4ض
@ابوأحمد-ث9ت4ض 5 ай бұрын
Thanks a lot
@sakmaestro3852
@sakmaestro3852 Жыл бұрын
Do u hvae udemy course complete project?
@neelamadhabpanda3959
@neelamadhabpanda3959 9 ай бұрын
Is there any php oop for beginner course in this channel . Before following MVC
@QuickProgramming
@QuickProgramming 9 ай бұрын
yes, its here kzbin.info/www/bejne/raOZdqilpLCpgrc
@neelamadhabpanda3959
@neelamadhabpanda3959 9 ай бұрын
@@QuickProgramming thank you 😊
@Saboor-Hamedi
@Saboor-Hamedi Жыл бұрын
This is amazing brother, but I encounter a problem here, I am using a live server, php -S localhost:8888, and when I run print_r($_GET), I get an empty array, could you help me with that, please.
@Psyzenn
@Psyzenn Жыл бұрын
For example I have allowedColumns array and I found the issue for example if I insert user I need "created" and when I update I need "modified" but never both together. Does this mean I have to create a new protected variable ?
@tunamusic2314
@tunamusic2314 5 ай бұрын
should we use framework, how tradition php over using framework (like laravel) ?
@jhalmu
@jhalmu Жыл бұрын
What is that "show" function you use in Database.php? And thanks fot tutorial. EDIT: Found it :)
@Test-u9q
@Test-u9q Жыл бұрын
please upload more MVC Project
@akordeonista
@akordeonista Жыл бұрын
Hi, one another question if I can. Why do we finish method without result by "return false"? Could we use also "return true" instead of "return false"?
@QuickProgramming
@QuickProgramming Жыл бұрын
i finish with false so that if the query doesnt work, it will return false. this can be used inside if statements to know if the query worked or not
@akordeonista
@akordeonista Жыл бұрын
@@QuickProgramming thanks for explanation, apprieciate your engagement👍
@abdomahmoud8769
@abdomahmoud8769 Жыл бұрын
As the 404 page is static, I think we don't have to create a controller for it since it won't deal with the database and won't need to be controlled.
@QuickProgramming
@QuickProgramming Жыл бұрын
the controller is required to load the view, so you cant have a page without a controller, unless you change the framework to accommodate that part. But its a waste of time to add extra code just to fix one page issue. Its just better to have an empty controller. less code, better performance
@abdomahmoud8769
@abdomahmoud8769 Жыл бұрын
​@@QuickProgramming It's not a big deal, anyway thank you for responding so quickly
@lloydnorbal3393
@lloydnorbal3393 Жыл бұрын
which one of the functions in the model class can to retrieve only the user id from a users table if no session has been set?
@QuickProgramming
@QuickProgramming Жыл бұрын
If there is no session then there is no user id. What are you trying to do? Maybe I can help
@QuickProgramming
@QuickProgramming Жыл бұрын
If you want to identify a user before they log in, you can use the session I'd. You can get that with this function $id = session_id();
@lloydnorbal3393
@lloydnorbal3393 Жыл бұрын
​@@QuickProgramming yes thanks, i am trying to incorporate the email verification function with the mvc model but with my version i am inserting the a row in the verification table when the user successfully signs up at this point no session has been set but i want to insert the verification record for a specific user the users table and the verification table is separated therefore i am trying to insert the verification record where the user_id is equal to the user_id from the users table NOTE the user_id in the verification table is a foreign key from the users table
@lloydnorbal3393
@lloydnorbal3393 Жыл бұрын
i tried this code to retrieve the user id from the user table $user_id = 96; $user_id = $user->first(['user_id' => $user_id]); $verify_post['user_id'] = $user_id->user_id; but it is hard coded to the user with id of 96 i want to modify this code s that is automatically selects correct user_id
@aymanalredi66
@aymanalredi66 Жыл бұрын
Hi sir, I didn’t understand why you used unset in update and insert for data, why is it needed at all?
@QuickProgramming
@QuickProgramming Жыл бұрын
unset is used to remove all keys from the array that are not found in the database table or the ones you dont want to allow edits. if you remove unset, the function will create a query that has columns that dont exist in the table and so your query will not run. e.g if you have a user signup page, you will have the following fields: username, email, password, retype_password, accept_terms_and_conditions. but your database table will have only these columns: username, email, password. so when you do this: $user->insert($_POST); the function will create a query that includes all fields from your form. this query will not work because it contains "retype_password" and "accept_terms_and_conditions". the unset part will remove these columns that dont exist in your table. you can also use this to make sure some columns are never edited, e.g the id column or date_created column. the unset part can remove these columns for you automatically from the query. watch this video where i use the framework to make a website kzbin.info/www/bejne/fqTTmZJjZqqVhqM
@aymanalredi66
@aymanalredi66 Жыл бұрын
@Quick Programming thank you sir, you are the best!
@krishu1632
@krishu1632 9 ай бұрын
Did you use laravel framework in this project?
@QuickProgramming
@QuickProgramming 9 ай бұрын
No, we made our own framework
@HughflynncomposerMP3
@HughflynncomposerMP3 Жыл бұрын
I had a problem with Model extends Database as a got a fatal error about not extending a Trait
@QuickProgramming
@QuickProgramming Жыл бұрын
you cant extend a trait, you use it instead. so put it luke this: class Model { use Database; //model functions and other code come here }
@lloydnorbal3393
@lloydnorbal3393 Жыл бұрын
Is this framework the same one used in the udemy website you did?
@QuickProgramming
@QuickProgramming Жыл бұрын
its very similar yes with some differences
@lloydnorbal3393
@lloydnorbal3393 Жыл бұрын
@@QuickProgramming ok than you great work
@ElMetzy
@ElMetzy Жыл бұрын
i dont know why im getting a 0 value for the array with empty value, also $_GET['url'] didnt worked for me i had to use $_SERVER['REQUEST_URI'] did this things changed with php 8?
@ashavdetroja1395
@ashavdetroja1395 Жыл бұрын
Why You're not Making Fully crud operation video?
@QuickProgramming
@QuickProgramming Жыл бұрын
i've made a few using this framework. here is one kzbin.info/www/bejne/anLSg4mZbZ6leNU
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,4 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 8 МЛН
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 260 М.
Create a Custom PHP MVC Framework in Just 1 Hour | Intermediate
45:55
Coding with Pixel Fix
Рет қаралды 2,2 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
When to use Traits, Interfaces, and Abstract Classes in PHP
15:08
Andrew Schmelyun
Рет қаралды 24 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 312 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 281 М.
Routing, Controllers, Views - Part 1 | PHP MVC Framework from Scratch
1:23:21
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 188 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,4 МЛН