2017 © Pedro Peláez
 

symfony-bundle content-publication-bundle

A simple yet efficient publishing bundle.

image

umanit/content-publication-bundle

A simple yet efficient publishing bundle.

  • Wednesday, June 20, 2018
  • by artggd
  • Repository
  • 3 Watchers
  • 1 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Publication Bundle

A simple yet efficient publishing bundle., (*1)

Install

Register the bundle to your 'app/AppKernel.php', (*2)

    new Umanit\ContentPublicationBundle\UmanitContentPublicationBundle(),

Usage

Make your entity publishable

Implement the interface PublishableInterface and use the trait PublishableTrait., (*3)

<?php

namespace App\Entity\Content;

use Doctrine\ORM\Mapping as ORM;
use Umanit\ContentPublicationBundle\Doctrine\Model\PublishableInterface;
use Umanit\ContentPublicationBundle\Doctrine\Model\PublishableTrait;

#[ORM\Table(name: 'news')]
#[ORM\Entity]
class News implements PublishableInterface
{
    use PublishableTrait;
}

This will add two fields to your entity, publishDate and unpublishDate. All your content will then be displayed only when the current datetime is between those fields., (*4)

(Optional) Disable the filter for a specific firewall

Usually you'll need to administrate your contents. For doing so, you can disable the filter by configuring the disabled_firewalls option., (*5)

# config/packages/umanit_content_publication.yaml
umanit_content_publication:
    disabled_firewalls: ['admin']

To follow this example, you'll need to add the admin firewall to your `security.yml file. Check out the Symfony documentation for more details., (*6)

The Versions

20/06 2018

dev-master

9999999-dev https://github.com/umanit/content-publication-bundle

A simple yet efficient publishing bundle.

  Sources   Download

MIT

The Requires

 

by UmanIT

doctrine symfony publication

20/06 2018

0.1

0.1.0.0 https://github.com/umanit/content-publication-bundle

A simple yet efficient publishing bundle.

  Sources   Download

MIT

The Requires

 

by UmanIT

doctrine symfony publication