2017 © Pedro Peláez
 

symfony-bundle carbon-bundle

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

image

lightsuner/carbon-bundle

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  • Friday, December 1, 2017
  • by lightsuner
  • Repository
  • 1 Watchers
  • 14 Stars
  • 51,422 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 9 Versions
  • 13 % Grown

The README.md

Carbon SF2 Bundle

Latest Stable Version Total Downloads Build Status, (*1)

Carbon datetime component
Symfony2 convertors, (*2)

This bundle provides an opportunity to convert Request and Form data into Carbon objects. Use a ParamConverter to convert Request data:, (*3)

``` php ... use Carbon\Carbon; ..., (*4)

/** * @Route("/blog/archive/{start}/{end}") * @ParamConverter("start", options={"format": "Y-m-d"}) * @ParamConverter("end", options={"format": "Y-m-d"}) */ public function archiveAction(Carbon $start, Carbon $end) { } ````, (*5)

No code changes are required for converting Form data. Symfony's built-in DateType and DateTimeType are automatically extended to return Carbon instances., (*6)

Installation

Step 1: Download Carbon SF2 Bundle using composer

Add Carbon SF2 Bundle in your composer.json:, (*7)

For sensio/framework-extra-bundle 2.x follow this link.

For sensio/framework-extra-bundle 3.x

``` json { "require": { "lightsuner/carbon-bundle": "2.*" } }, (*8)


Now tell composer to download the bundle by running the command: ``` bash $ php composer.phar update lightsuner/carbon-bundle

Composer will install the bundle to your project's vendor/lightsuner directory., (*9)

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*10)

``` php <?php // app/AppKernel.php, (*11)

public function registerBundles() { $bundles = array( // ... new LightSuner\CarbonBundle\CarbonBundle(), ); } ```, (*12)

The Versions

01/12 2017

dev-master

9999999-dev

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

The Development Requires

01/12 2017

2.2.0

2.2.0.0

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

The Development Requires

26/08 2016

dev-develop

dev-develop

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

19/08 2016

2.1.1

2.1.1.0

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

10/08 2016

2.1.0

2.1.0.0

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

01/08 2016

dev-revert-5-forms

dev-revert-5-forms

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

11/03 2015

2.0.0

2.0.0.0

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

09/03 2015

1.x-dev

1.9999999.9999999.9999999-dev

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires

 

09/03 2015

1.0.0

1.0.0.0

Provide Carbon datetime lib. as annotations param. converter (SensioFrameworkExtraBundle)

  Sources   Download

MIT

The Requires