markei/silexwebsiteframework

Quickstart building sites with Silex, Twig, Symfony Forms, Imagine and Swiftmailer

v1.1.2 2018-02-05 06:55 UTC

This package is auto-updated.

Last update: 2024-12-13 12:09:15 UTC


README

The Markei.nl SilexWebsiteFramework configures all the standard vendors you need to build a site with Silex: Twig, Symfony Forms, Imagine and Swiftmailer

Quick start

Create your own Application.php and start registering your routes.

<?php
namespace Acme\AcmeWebsite;

use Markei\SilexWebsiteFramework\Application as BaseApplication;
use Symfony\Component\HttpFoundation\Request;

class Application extends BaseApplication
{
    protected function getRequiredConfigurationFields()
    {
	return array_merge(parent::getRequiredConfigurationFields(), []);
    }

    protected function registerRoutes()
    {
	$this->get('/first-page', function (Application $app, Request $request) { return $app['controllers.page']->showPageAction($request, 'first-page'); });
	$this->get('/second-page', function (Application $app, Request $request) { return $app['controllers.page']->showPageAction($request, 'second-page'); });
	parent::registerRoutes();
    }

    protected function registerControllers()
    {
	parent::registerControllers();
    }
}