Jump to content

Simonss

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Simonss's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well Ive had a further day of development and have already started to apply the MVC pattern. While it can seem like a long winded way to go about things sometimes I know that in the end this is going to help me out.  Have now got three groups of classes. Model classes interact with the DB and this is also the category I would put the standard classes (getter and setter classes). View classes just call for the appropiate data and output it.  Most of the work to generate the html is done in the Controller classes.  Currently these classes also use a short switch statement to determine what function should be called.  Eg an Event can be created, edited or deleted hence the action variable ($_GET) is checked and used to determine the function called. Controller classes hold everything together. Do most of the work etc. One point im slightly unsure about - I read a little about in another thread but this is slightly different. Is there anything wrong with the switch statement in the view? Is there a better method that I should be using? Thanks, Simon
  2. Hi Ober, I solved my problem in the end - frustratingly it was a stupid mistake that was causing the error.  When I was returning the form from ajax, I was setting the id of the input elements but not the name. When the new form was then submitted none of the form elements could be got at using $_POST['elementname']. After working on it for a few hours - going back to a standard php version and realising my mistake I solved it in 2 mins!
  3. I have a page that lets the user select a template for a form from a drop down. Using a JS onclick, this then gets the form template from the database using ajax. Problem i have is that when I submit the page I am unable to use the data that should have been posted.  It doesn't appear to post it. Any ideas of what I can do?
  4. Hi All, New to php freaks and also fairly new to PHP. Here is what im up to; Im creating a fairly beefy application that involves probably around 60% updating to 40% querying of a database. What I dont currently know is the best practices' I should be applying to this application.  My experience of Java and JSP, OO design etc has brought me to this. The Three layers Top: Displaying of objects to user - basic objects that display info in the way a user would expect Middle: Holding Classes that are used to maintain information for specific instance of classes - these classes only really have getters and setters, nothing fancy. Bottom: Database interaction, queries and updates - each of these classes is used to create instances of the Middle layer class associated to it.  For example TemplateSQL is used to create a Template instance class. Am I on the right track with this?  Is this poor design? If anyone can give some hints, tips, books/articles that relate to this type of thing it would be much appreciated. Hopefully as I get some more experience with this and further projects I can start helping other people rather than just turning up here and asking away! TIA, Simon
×
×
  • 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.