Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

sergeyfedotov/symfony-typography-bundle

Repository files navigation

Symfony Typography Bundle

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);
    // ...
}

About

Symfony Typography Bundle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages