title: Is the state design pattern overkill for a PHP form?
body: <p>I have a page that, when accessed displays a table of information related to a video:</p>
  
  <ul>
  <li>Embed code</li>
  <li>Title</li>
  <li>Description</li>
  <li>Current gallery</li>
  <li>Thumbnail image</li>
  </ul>
  
  <p>This information is read-only when the page is first accessed.</p>
  
  <p>There is a select menu that has the following options:</p>
  
  <ul>
  <li>Edit Description</li>
  <li>Create Thumbnail (Upload/Replace)</li>
  <li>Edit embed code</li>
  <li>Change Gallery</li>
  <li>Delete video</li>
  </ul>
  
  <p>When the user selects an option, the same initial table of data is displayed, but the relevant form input is displayed where necessary. </p>
  
  <p>For example, if "Edit Description" is selected, the page reloads and the description text is replaced with a text input. If "Create Thumbnail" is selected, then a file upload input is displayed. </p>
  
  <p>The idea is to display all of the information together but to limit how much can be edited at a time.</p>
  
  <p>I know the state pattern is a possible solution, since each piece of data can be in atleast one of two states:</p>
  
  <ol>
  <li>Display State</li>
  <li>Form input state</li>
  </ol>
  
  <p>But, my question is, would using the state pattern be overkill? </p>
  
  <p>At the moment, each time the page is accessed, each part of the form decides with a switch statement whether it should be in 'display' or 'input' state and then acts accordingly. I wonder if implementing the state pattern design would make altering the form and creating similar forms easier down the road.</p>
  
  <p>Thanks!</p>