declare(strict_types=1);
namespace FixtureProject\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class StaticRoutesController extends AbstractController
{
/**
* @Route("/parametrized/{param1}/{param2}", name="parametrized_route")
*/
public function withParameters(string $param1, string $param2) : Response
{
return $this->render('parametrized.html.twig', ['param1' => $param1, 'param2' => $param2]);
}
}
declare(strict_types=1);
namespace FixtureProject\Source;
use NorbertTech\StaticContentGeneratorBundle\Content\Source;
use NorbertTech\StaticContentGeneratorBundle\Content\SourceProvider;
final class ParametrizedSourceProvider implements SourceProvider
{
public function all() : array
{
return [
new Source('parametrized_route', ['param1' => 'first-param', 'param2' => 'second-param']),
];
}
}
php -S localhost:8000 -t output
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.