Welcome Guest, Not a member yet? Register   Sign In
Properly structuring methods/views in classes
#1

[eluser]mabright[/eluser]
Hello,

I am writing a, lets just call it a classifieds script. I have a class called POST. I currently have several methods in this class such as ones for showing all ads (based on user's current location/area), posting a new ad, previewing ad before posting, searching post, etc.

My home page actually starts off with this class so the home page is mysite.com/post and here is where I show a listing of current post based on where the user is located (city,state).

I am thinking that I need to separate the out some of the methods/functions in this class but not sure how. I thought of this when I was developing the preview method for when new ads are posted and I had issues going back and forth between preview and edit ad methods, etc..

So basically when a users searches or views posts the url is mysite.com/post. When a user adds an ad the url is mysite.com/post/add, preview is mysite.com/post/preview, etc.

Am I doing this correctly is the normal/standard practice as far as structuring this class, methods, etc.?




Theme © iAndrew 2016 - Forum software by © MyBB