Skip to content

Instantly share code, notes, and snippets.

@ciarand
Created October 24, 2014 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciarand/4dc6cb6a4a2f17cec7be to your computer and use it in GitHub Desktop.
Save ciarand/4dc6cb6a4a2f17cec7be to your computer and use it in GitHub Desktop.
playing around with multiple steps
<?php
class FooBar
{
public function doThing()
{
while (true) {
// just render the regular view for non-post reqs
if (!Request::isPost()) {
break;
}
// if the input doesn't include keyFields, abort
if (!$keys = Input::get("keyFields")) {
Flash::error("No data submitted");
break;
}
if (!$this->doAnotherThing()) {
Flash::error("Could not identify those values");
break;
}
if (!$this->doOneMoreThing()) {
Flash::error("Incorrect information. Please try again");
break;
}
return $this->processActivation($model);
}
return $this->renderActivationPage();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment