TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-10-2009, 11:21 AM   #1 (permalink)
The Wanderer
 
sunwukung's Avatar
 
Join Date: Jul 2009
Location: Bristol
Posts: 8
Thanks: 0
sunwukung is on a distinguished road
Default Controlling partial views in MVC

My question here pertains to a design decision.

I've set up an FC of sorts - it takes parameters from the $_GET array and loads the appropriate sub-template into a master template using an include. Each sub-template also performs a similar trick, and loads in a set of partials to allow for complex layout requirements. As I was doing this, I got the sneaking suspicion I hadn't quite grasped everything - the Model wasn't making a significant appearance (although to be fair the 'application' has little in the way of a data layer).

Then I figured I should tackle the contact form, which requires three states/views, submitted with no errors, submitted with errors, and not submitted. I've seen a number of approaches to this problem, and I wanted to get some feedback. What I intend to do is invoke a command within that partial that handles the request data and invokes the relevant view.

I looked at application controllers, but the examples I've seen simply loop through an array of commands, and I need to execute a command/control per partial, so I'm not sure if this is the right way to go.

So, my question is:

1. what pattern would you recommend in this situation? Application Controller, Command or Page Controller.
2. How would you define the component I've described?


Caveat: The "application" is nothing more than a basic brochure site, but I wanted to tackle something simple to grasp the concept.
sunwukung is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Views on transferring code ownership jcorradino General 4 12-05-2008 11:04 AM


All times are GMT. The time now is 01:45 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design