/** * This action shows how to use the Symfony validator for a higher-level, more powerful version * of route parameter assertions. */ public function validateAction($name) { $app = ExampleApp::getInstance(); $errors = $this->validator->validateValue($name, new Assert\Type(['type' => 'numeric', 'message' => 'Error, {{ value }} is not a valid {{ type }}'])); if (count($errors) > 0) { return new Response((string) $errors); } return new Response("Hello, " . $name); }
<?php require_once __DIR__ . "/../vendor/autoload.php"; use FlintExample\ExampleApp, Flint\Config; $config = Config::getInstance()->load(__DIR__ . "/../app/config.php"); $app = ExampleApp::getInstance($config); $app->run();