Skip to content

Markei/silex-website-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilexWebsiteFramework

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();
    }
}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published