-
-
Save dennis-fedco/fc8164c84a5919d927519966e0ace0f0 to your computer and use it in GitHub Desktop.
Form Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyFormFactory | |
{ | |
public function __invoke(ServiceManager $container) | |
{ | |
/** | |
* code to get quote id | |
*/ | |
if (isset($_GET['quote_id'])) | |
$quote_id = filter_var($_GET['quote_id'], FILTER_VALIDATE_INT); | |
else if (isset($_SESSION['quote_id'])) | |
$quote_id = filter_var($_SESSION['quote_id'], FILTER_VALIDATE_INT); | |
else | |
$quote_id = 0; | |
$repository = new MyRepository($quote_id, $container->get(MySql::class)); | |
return new MyFormAction($repository, $container->get(PhpRenderer::class)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment