sylvertwst Posted October 20, 2008 Share Posted October 20, 2008 hello all, i've just recently begun learning php, i only have the very basic experience with programming elements as loops conditionals etc, but i'm learing:) to start of with the state of the art methods i want to take off in php with OO, i've found a number of excellent tutorials, but they all explain the same things. that a dog has 4 legs and a head and he can bark and poop, you know what i mean. yay i learnt some new stuff. while it is essential for beginners as me to understand this, i'm beyond this stage. i need to know how to implement this model in things such as building a page class. building object oriented code for a login system. anything to get me going on how it is actually implemented and how i can start developing my own code. any pointer or anyone know a good tutorial beyond the metaphorical dog? thanks a lot Sylvertwyst edit:: o.o we have an oop section. srry for this. can an admin move please? Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/ Share on other sites More sharing options...
trq Posted October 20, 2008 Share Posted October 20, 2008 any pointer or anyone know a good tutorial beyond the metaphorical dog? I'd suggest pulling apart one of the bigger frameworks. Codeignitor is a pretty simple one to start with. This will let you see how the different design patterns work together. Have you read the OOP tutorials on this site? Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/#findComment-670399 Share on other sites More sharing options...
sylvertwst Posted October 20, 2008 Author Share Posted October 20, 2008 that looks like an excellent body of objects. i have one concern though. the manual states that it is written in php4. arent the differences between php 4 and 5 a little too great for me to start studying this framework? Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/#findComment-670404 Share on other sites More sharing options...
discomatt Posted October 20, 2008 Share Posted October 20, 2008 Classes and OOP are ( for me ) a way to reuse code more efficiently. I start with my most basic elements... database interaction, form building, ect. and make classes for those ( or grab ones i've made in the past ) and work my way up from there. Any time I run into something that I know will have to be done more than once, I write a class... sometimes extending 'lower-level' classes to simplify my final code. I like to start with the solution and work my way backwards. For example... if a CMS was my final solution, I would break it into it's most basic parts... Layout, Content Manipulation, Login/Security. I work with those as 'new solutions' and break them up into their most basic parts. For example - Login/Security will need to access the database, will need a front end ( form ), will need hashing, will need cookie/session interaction. Eventually you will notice that you repeat a ton of solutions... these will become your low level classes that you'll later extend or use directly in your higher level solutions. I find programming this way leaves me with a very clean script... the end result being a few conditional statements and class calls. Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/#findComment-670406 Share on other sites More sharing options...
trq Posted October 20, 2008 Share Posted October 20, 2008 The patterns are the same in any version or even language. Maybe you've missed the 'design patterns' stage? That really is the heart of OOP, not simply knowing the syntax to create a class. You could try here for a nice intro. Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/#findComment-670407 Share on other sites More sharing options...
sylvertwst Posted October 27, 2008 Author Share Posted October 27, 2008 i was unable to work a week or so due to an accident. thank you for your replies, i'm checking out the design patterns tutorial right now. it may be exactly what i was looking for Link to comment https://forums.phpfreaks.com/topic/129313-beyond-myfirstoophptutorial-tm/#findComment-675595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.