Coder Social home page Coder Social logo

kepten / knpmarkupvalidatorbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from knplabs/knpmarkupvalidatorbundle

1.0 1.0 0.0 600 KB

Provide markup validation for your Symfony2 based projects

Home Page: http:/knplabs.com

License: MIT License

PHP 100.00%

knpmarkupvalidatorbundle's Introduction

Markup Validator Bundle

Bundle that provides markup validation functionality to your Symfony2 based projects.

This bundle is in early development state, so any contribution is welcome! ;)

Define validators

The first step, when the bundle is installed in your project, is to define validators in your application configuration:

# app/config/config.yml
knp_markup_validator:
    default_validator:  default
    validators:
        default:
            processor:  tidy

It tells to the markup validator extension to create a validator service named markup_validator.default_validator using the tidy processor.

The default_validator tells the extension to create the markup_validator service which is an alias for the markup_validator.default_validator one.

You can define as many validators as you want.

Processors

Processors are used by the validator to validate the markup. They are responsible to return an array of warning and error messages.

The bundle provides two processors:

  • w3c which uses the validator.w3.org's api
  • tidy which uses the tidy binary

If you want to define your own validator, you simply need to create a service implementing the Knp\Bundle\MarkupValidatorBundle\Validation\ProcessorInterface with the markup_validator.processor tag and its name as alias tag attribute. The extension will create a service for each validator named as follow: markup_validator.{{ alias }}_processor.

knpmarkupvalidatorbundle's People

Contributors

herzult avatar mbontemps avatar ruian avatar docteurklein avatar

Stargazers

Robert Kiss avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.