title: CakePHP decision based system
body: <p>I've been tasked to build a web application whereby users are asked a series of related questions. Users are required to fill out form data to give their responses a weight. The weight determines the next series of questions and ultimately the information shown.</p>
  
  <p>I am planning on building the application using CakePHP and could opt to use either 2.x or 3.x. I have previous experience using 2.x but am new to 3.x</p>
  
  <p>My question is what is the best way to build this type of system using CakePHP and does it have any features within the framework that would help (I've looked at the Tree behaviour which looks like it might be useful)?</p>
  
  <p>As an example this is the flow of the application:</p>
  
  <ol>
  <li><p>User arrives at a web page and selects a topic. These topics are broken into 2 levels (category -> sub-category).</p></li>
  <li><p>The sub-category presents a question. The user is required to provide a score (from 0 to 10) to weight their response. </p></li>
  <li><p>Based on the response, a further question will be presented. </p></li>
  <li><p>Based on the response to (3) links to further information will be shown. These links will actually be to content managed pages within the application so are likely to link to records in a 'Pages' model.</p></li>
  </ol>
  
  <p>The responses given at (4) are likely to be processed in a threshold manner, i.e. if the user puts in 0 - 3 they get one set of pages, 4 - 6 another, 7 - 10 another, etc.</p>
  
  <p>I appreciate this is quite a general question and there are likely to be various approaches but I'm interested in getting different responses to do with:
  (a) Features of the framework which could speed up development.
  (b) How to build this in an efficient and flexible way. All of the content for this will be managed by a client, so I need to factor in how to edit and add to the data.</p>
  
  <p>One of the key things I'm interested in is how to make the links between all the questions in (2) to (3). One approach might be to use 2 tables with links between them. But that seems very inflexible because if the application needs additional layers of questions, it would involve adding a table/model every time - seems very inefficient and wrong.</p>
  
  <p>Thanks.</p>