2017 © Pedro Peláez
 

library static-page-bundle

Static page manager bundle

image

sokil/static-page-bundle

Static page manager bundle

  • Monday, October 17, 2016
  • by sokil
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

StaticPageBundle

Installation

Install bundle through composer:, (*1)

composer.phar require sokil/static-page-bundle

Add bundle to AppKernel:, (*2)

<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
            new Sokil\StaticPageBundle\StaticPageBundle(),
        );
    }
}

Configuration

Page view

Place file to app/Resources/StaticPageBundle/views/Page/index.html.twig with your own markup of static page. Page instance Sokil\StaticPageBundle\Entity\Page accessable as page variable, also locale must be passed to template. To get localized data, call page.getLocalizations()[locale] which gives you instance of Sokil\StaticPageBundle\Entity\PageLocalization., (*3)

Routing

To enable default routing configuration just add routing.yml to you routes config app/config/routing.yml:, (*4)

static_page:
    resource: "@StaticPageBundle/Resources/config/routing.yml"
    prefix:   /

Or add your own routes for required actions., (*5)

To route any unexisted url to static page handler, you need to add some configuration to app/config/config.yml:, (*6)

cmf_routing:
    chain:
        routers_by_id:
            router.default: 200
            static_page.page_router: 100
    dynamic:
        persistence:
            orm:
                enabled: true

Roles

Register role at app/config/security.yml:, (*7)

# http://symfony.com/doc/current/book/security.html
security:
    encoders:
        FOS\UserBundle\Model\UserInterface: sha512

    # http://symfony.com/doc/current/book/security.html#hierarchical-roles
    role_hierarchy:
        ROLE_PAGE_MANAGER:          [ROLE_USER]

SPA view

Bundle has some SPA routes and dependencie for managing static pages, so you can configure them, for example with sokil/frontend-bundle:, (*8)

{% import "@FrontendBundle/Resources/views/macro.html.twig" as frontend %}
{% import "@StaticPageBundle/Resources/views/macro.html.twig" as staticPageSpa %}

{{ staticPageSpa.jsResources() }}






Deploy

If you want to use embedded editor, you need to setup SPA., (*9)

You need to execute grunt tasks to build SPA:, (*10)

npm install
bower install
grunt

Bundle uses assetic bundle, so you need to register it in assetic config:, (*11)

assetic:
  bundles:
    - StaticPageBundle

The Versions

17/10 2016

dev-master

9999999-dev

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

17/10 2016

0.3

0.3.0.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

24/08 2016

0.2.2

0.2.2.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

22/08 2016

0.2.1

0.2.1.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

22/08 2016

0.2

0.2.0.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

03/08 2016

0.1.1

0.1.1.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil

03/08 2016

0.1.0

0.1.0.0

Static page manager bundle

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

by Dmytro Sokil