Jump to content

beyond MyFirstOOphpTutorial (TM)


sylvertwst

Recommended Posts

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

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.