15. Composer | ActiveRecord Save | CMS OOP tutorial MVC

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 57

  • @dagogouranta5583
    @dagogouranta5583 2 ปีที่แล้ว +1

    Ahh mr Dalibor , I stuck with your playlist and have finally finished, I feel much more confident in php , especially in good practices for OOP and not repeating code , (among other things). Thanks once again , I look to buy your design patterns course in the future !

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Thanks for your comment Dagogo, glad you found this course useful.
      I was thinking these days to add more lessons to it, but... not sure how much value would they provide to be honest. I am entertaining the idea that after 10+ hours on one mini project, people should move on to either work on it on their own, or do something else.
      Do you have any thoughts now about what you enjoyed in the series, and what could be improved?

    • @dagogouranta5583
      @dagogouranta5583 2 ปีที่แล้ว +1

      @@ApplicableProgramming well I am quite content with what you put out in the course, it was good the way you integrated major concepts in almost every new video , I really enjoyed that . In terms of what can be improved, umm I have to think really hard because a lot of things in the course were great ! If I absolutely HAD to say something it would be that I found myself having to rewind a lot, to try and understand what you did when refactoring code, so maybe you can be more direct when getting to the point . This may not even be your fault, it may just be my level of understanding 😅.it’s not really a big deal, and I am still really grateful for the course.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      @@dagogouranta5583 Thanks for the feedback. Yeah, it is difficult to balance speed, amount of information and getting to the point. I struggle with that myselft I think.
      Congratulations on sticking with the course. What is next for you ? :)

  • @janroehikoge2130
    @janroehikoge2130 2 ปีที่แล้ว +1

    just started this course two weeks ago and finished ep15 just now. i've coded along and learned A LOT.
    You are doing something great Sir.
    what you teach is really applicable and the jokes are great! so i bought your design patterns course without hesitation (for more jokes).
    Thanks and love from the Philippines

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Thank you Janroe, that is awesome to hear that the course helped you. It is why I make these tutorials in the first place. Congratulations on your purchase, and welcome to the course, I hope you will be happy with your investment (although, there are that not many jokes in the course. Now that I think about it... perhaps there should be).
      I ask this all students, what is the "big dream" in your career, what is the next thing you would like to achieve?

    • @janroehikoge2130
      @janroehikoge2130 2 ปีที่แล้ว +1

      @@ApplicableProgramming , the goal is to achieve a level of mastery wherein every feature implementation and bug fix would be effortless and elegant.
      im pretty sure what you teach will be essential to that goal. so more power to you Sir

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      To be honest, that is the first time someone is focused on "cause" rather then "result". Usually people name job offers or new car or... What you mentioned is a long term investment, so i think you are on to something, regardless of which course you take :)
      But i do appreciate the feedback, thanks!
      Do you work professionally with PHP? For how long?

    • @janroehikoge2130
      @janroehikoge2130 2 ปีที่แล้ว +1

      @@ApplicableProgramming i enjoy both the cause and result. the best feelings i ever had was when i've fixed a problem that im trying to solve for hours.
      what i like about the process of web dev is that you (1) either solve the problem quickly which is nice (2) spend hours (or days) trying to find the solution for the problem, finding it and finally solving the problem, or (3) there is an anomaly in the language / framework; then you have just discovered a bug which is an achievement in itself.
      All these outcomes makes you grow as a developer. youve worked in this field for almost 20 years now, what do you think? how did you deal w burnout?
      By the way, i really appreciate the fact that you've put your resources/references in your design course. i was amazed before and im even more amazed now. :)

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@janroehikoge2130 I agree, what you are describing is pretty much a typical engineering path to problem solving. You have a set of tools, and you try to make something new/better.
      About burnout, great question man... I should probably make a video about it, but what I do is just listen to my "interest". If I feel like I worked too hard on something, I take some easier tasks for a few days. F.eks., if I am working with authentication for a day or two, and I notice that I begin to think about it when I am not working, while I talk to other people or while I lay in bed at night, then I take a brake from it and work on some styling, or on some tasks that do not require me to think hard about it. I also take a few hikes, call up some friends and go for a motorcycle ride. Out camping or photographing, whatever I can to get my mind of it. Because if I keep pushing, it doesn't get any better. I guess it is individual, but it requires some level of self control.
      The same principle goes for youtube and courses, I get into same "flow" that can last for days or longer, and I do use it to write a few videos or examples, but then I force myself to take a few days brake and just watch tv or something, because I know that if I keep pushing, I will hate it eventually. So just switch focus I guess :)
      What did you mean by resources/references in the course? The links to frameworks for modules or?
      (btw, just sent you a private video I send to all students, in case it ended up in the spam folder :) )

  • @msq7521
    @msq7521 3 ปีที่แล้ว +4

    finally another episode

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว +1

      It has been a while for sure :)
      Any suggestions what would you like to see next?

    • @majalayagamelab5088
      @majalayagamelab5088 3 ปีที่แล้ว +2

      @@ApplicableProgramming tutorial make a post and pagination, thanks hihi

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      @@majalayagamelab5088 That is a good suggestion thanks, I will add it to the list

    • @aismedia9611
      @aismedia9611 3 ปีที่แล้ว

      @@majalayagamelab5088 Yeah, agree👌

  • @Ctrl_Alt_Elite
    @Ctrl_Alt_Elite 5 หลายเดือนก่อน

    Thanks so much for this series, I know it has been a while since it was uploaded but regardless, I have learned a lot about PHP & OOP and feel confident enough to try to build something now. Cheers 🍻

    • @ApplicableProgramming
      @ApplicableProgramming  5 หลายเดือนก่อน

      Thank you, glad you liked it :) it was a lot of fun making it

  • @igu642
    @igu642 ปีที่แล้ว +1

    i am watching ithink this going to help me lot iam a begginer i love php you are awesome

  • @b4rt1j1
    @b4rt1j1 2 ปีที่แล้ว +1

    I have just finished this playlist coding along. Thank you so much, I've learned A LOT!

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Great to hear man! Do you remember what was your favourite AHA moment from the tutorial?

    • @b4rt1j1
      @b4rt1j1 2 ปีที่แล้ว +2

      @@ApplicableProgramming Probably xdebug, that tool was new for me and it's so usefull. Functionality behind password hashing is also amazing. And surprisingly the way of validating input data - writing such a clean and reusable code.
      And a little question - Should'nt Entity, Page, User and so on be in the Models folders? Or what type of code should I put in the models. Thanks

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@b4rt1j1 Thanks for the summary, it means a lot. Good question about folders. The plan was (and still is) to make the cms modular, or somewhat DomainDriven (check DDD by uncle Bob) so that we could install different plugins to it. Honestly not sure when I will make those videos, but that was the plan at least.
      About where to put files, I would not worry about that too much, as if you use namespaces and a decent IDE, moving files takes 3 seconds, literally. So one day when you find a better solution, just move them and call it a day :)
      which IDe are you using, VS code?

    • @b4rt1j1
      @b4rt1j1 2 ปีที่แล้ว

      @@ApplicableProgramming Thanks for the tip about DDD, I will take a look at it.
      I tried a lot of free IDEs and the VScode seems the easiest one to configure and is working fine with some php extensions.

    • @b4rt1j1
      @b4rt1j1 2 ปีที่แล้ว +1

      @@ApplicableProgramming Now Im building my own cms and right now Im making a gallery where image file names, titles, statuses etc. Are saved in a Database. Displaying all images is working good using one foreach loop and fetchAll. Now when user clicks on the image there is an anchor behind it with href= /gallery/single/.
      I would like to ask you do I have to save all the urls in the database? Or is parsing the url also solution?
      EDIT: I've put the form with invisible button and hidden input into foreach loop so every image is basically button that reditects to gallery/single_post. In GalleryController singleAction takes the image id from $_POST and displays the image with that id. Please correct me if this is wrong approach and how it should be done.

  • @sviatstupak2162
    @sviatstupak2162 ปีที่แล้ว +2

    Good day! I finished your course and I can conclude that it is the best course I have ever come across. I really liked the presentation of the material and how you understand the essence of the problem you are trying to solve down to the last detail. I really want to take your course on PHP patterns, but there is currently a war in my country and I cannot afford to buy it for myself. It would be great if you would make it possible to purchase it by paying in installments, at least in three installments. Thanks again for such a great course.

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว +1

      Thank you for your kind words Sviat. I am from Serbia, so I understand a bit about living in the war zone. So about the course, I think I have an "easier" solution. Please go to www.applicableprogramming.com and fill in the form with your contact details (either contact, or register your interest), and I will get back to you with details in the next few days.
      Hope you and your close ones are safe, hope to hear from you.

    • @sviatstupak2162
      @sviatstupak2162 ปีที่แล้ว

      @@ApplicableProgramming Thank you for your attention and support.
      I will fill out the form in the support section

  • @aruppaul1468
    @aruppaul1468 2 ปีที่แล้ว +2

    wow nice tutorial... please provide next lesson

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Thanks Arup. Any ideas about what you would like to see next?

  • @minhan4444
    @minhan4444 2 ปีที่แล้ว +1

    Nice tutorial , I can't wait for the next lesson ^^

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Glad you asked Minh an, I was wondering if someone is following this tutorial up to this episode :)
      I will soon start working on the new episode. Do you have some suggestions on what topic to cover?

    • @minhan4444
      @minhan4444 2 ปีที่แล้ว +1

      ​@@ApplicableProgramming Maybe tutorial for shopping online with MVC model since I'm a medium PHP so I don't have a lot of idea about that.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@minhan4444 Yeah that one comes from time to time, just not sure if that is a completely new tutorial, or it could be part of this CMS, not sure..
      Do you think it should be a separate tutorial? and it should skip some of the parts of this CMS tutorial (mvc, objects etc?)

    • @minhan4444
      @minhan4444 2 ปีที่แล้ว +1

      @@ApplicableProgramming I think you should continue with the CMS project because I also want to know the end of this project.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      @@minhan4444 Uh.. that is a though one :) A true CMS project is always ready, but never finished :D

  • @1stimpressiondental174
    @1stimpressiondental174 2 ปีที่แล้ว +1

    A tutorial for unit testing from the config and from smaller test to more complicated ones wounds like a good idea.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      That is a great suggestion! I was also thinking on making a full course on it, but... it all comes down to the time for doing it :)
      Are you finished with the entire series on the CMS, have you started building your own without looking at the tutorials?

    • @1stimpressiondental174
      @1stimpressiondental174 2 ปีที่แล้ว +1

      @@ApplicableProgramming yes, I am caught up with the series, but I have not started it from the scratch. That should be a great way to learn. For some reason, I find the foreach loops for setting values or getting values intimidating. It seems simple enough, but I guess I need a little more practice on that.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@1stimpressiondental174 I guess that is basically it. If you start say 5 or maybe even 10 different loop exercises (but not just watch code, write your own code) you will pretty much master it. Just store some data in the loop, dump it and then get it out right after, and dump it again to see the flow of the data

  • @mmtiktok3869
    @mmtiktok3869 3 ปีที่แล้ว +1

    thank you ...

  • @Ctrl_Alt_Elite
    @Ctrl_Alt_Elite 5 หลายเดือนก่อน

    26:21 One thing I don't understand is when I should prefer dependency injection vs setting a value directly on a property
    For example, in the case of our models, we inject $dbc, however with PageController we set it directly as a property. In the case of our logger also, we set it as a property on the PageController.
    Could you provide some clarification on this mayber? When is each acceptable? Is one a better practice than the other in all cases? If not what are the exceptions?

    • @ApplicableProgramming
      @ApplicableProgramming  5 หลายเดือนก่อน

      You can do both basically. You do have an option to customize "setters" if you do it via method and injection, and then it is actually a dependency injection. It is also preferred at it is expected behavior in practice.
      But.. it works fine if you just set it directly. You can also test and see which works better, but from my experience, as the class gets more complicated, the dedicated method is preferred.

  • @ajninanin4851
    @ajninanin4851 3 ปีที่แล้ว +2

    Sale, please. I'd love to purchase the course but I only have enough money.

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      I considered about giving another discount, but it would not be fair for others who purchased the course in the beginning.
      To be honest, price will most likely go up to 100$ very soon when I start investing in some marketing, so the current price is basically a sale price already.

  • @b4rt1j1
    @b4rt1j1 2 ปีที่แล้ว +1

    Hi sir, How far would you go with that managing in cms? If i get it right we are basically making GUI for web owner to manage content - adding/changing/deleting titles, text, pictures, products... But how far it goes? Should the owner for example be able to disable navbar buttons?
    And should I care about sanitizing user input in my portfolio cms project since Im not using any framework that handles sanitizing for us?
    Thanks :)
    I hope Im at least helping YT alghorithms draw attention to ur videos with my annoying questions :D

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Good questions El Bartos... It goes as far as you or client want to, or as far as the budget allows, or as far as it makes sense. The more you make, the more features you have, but it is also more complex to use, and more complex to maintain and develop. So... You make 80% of solution, because usually rest 20% give almost no benefits.
      I would recommend downloading some CMS to see what they have, like Craft CMS or October CMS or something similar, and see what they have integrated out of the box.
      They all ship with some functionality, and then there are usually some specific plugins for specific things.
      Are you planning on building one CMS for general purpose, or just for practice?

    • @b4rt1j1
      @b4rt1j1 2 ปีที่แล้ว +1

      @@ApplicableProgramming Thanks I appreciate your rich answer, Im making my own CMS since i've finished your darwin playlist to have some portfolio project for the job Im looking for. :)

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@b4rt1j1 Then just make what you think is interested. What I always found useful is to elaborate a bit more then just code (why is this feature useful for companies, how can they save time and earn more money and things like that, what companies like to hear).
      Good luck in job search! Exciting times for sure...

  • @abdelahimabuelmaaref3992
    @abdelahimabuelmaaref3992 4 หลายเดือนก่อน

    Is the series full?

  • @Максим-в4ж8п
    @Максим-в4ж8п 11 หลายเดือนก่อน

    Hello, I have done homework, and can u please explain me why my version is bad in comparison with your?
    @controller
    $pageId = $_GET['id'];
    $page = new Page($this->dbc);
    $pageHandler['pageObj'] = $page->findBy('id', $pageId);
    if($_POST['action'] ?? 0 == 1){
    $title = $_POST['title'];
    $content = $_POST['content'];
    if($title != $pageHandler['pageObj']->title || $content != $pageHandler['pageObj']->content){
    $field = [$title, $content, $pageId];
    $page->changePage($field);
    header('Location:/admin/?module=page');
    }
    }
    @entity
    $sql = "UPDATE $this->tableName SET title = ?, content = ? WHERE id = ?";
    $stmt = $this->dbc->prepare($sql);
    $stmt->execute($fieldValue);
    return $stmt;