fsv/typography-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony typographer

dev-master 2016-05-10 11:52 UTC

This package is not auto-updated.

Last update: 2022-10-15 07:49:51 UTC


README

Build Status

Installation

$ composer require fsv/typography-bundle
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Fsv\TypographyBundle\FsvTypographyBundle(),
    );
}

For lazy typographers initialization:

$ composer require ocramius/proxy-manager:^1.0

Configuration

# app/config/config.yml

fsv_typography:
    typographers:
        default:
            mdash:
                options:
                    Text.paragraphs: off
        another:
            smartypants:
                attr: 1
        service:
            id: my_service_id
# ...

Disable form extension:

fsv_typography:
    enable_form_extension: false

Usage

// AppBundle\Form\Type\ExampleFormType.php

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('content', TextareaType::class, [
        'typography' => 'default'
    ]);
    // ...
}
// AppBundle/Controller/ExampleController.php

public function exampleAction()
{
    // ...
    $content = $this->get('fsv_typography.typographer_map')->getTypographer('default')->typography($rawContent);
    $content = $this->get('fsv_typography.typographer_map.default')->typography($rawContent);
    // ...
}