Download the PHP package edsi-tech/sir-trevor-bundle without Composer

On this page you can find all versions of the php package edsi-tech/sir-trevor-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sir-trevor-bundle

SirTrevor Bundle by EDSI-Tech Sarl

Integration of SirTrevor JS library into a Symfony2 bundle.

SirTrevor editor works with "blocks", fragment of content of different types. This bundle allow you to map those to Doctrine entities. Secondly, it provides a TwigExtension & templates to easily achieve a clean SirTrevor integration.

SensioLabsInsight

Installation

Using packing, require edsi-tech/sir-trevor-bundle Then register it in app/AppKernel.php.

Usage

Model

You must extend EdsiTech\SirTrevorBundle\Entity\AbstractBlock. AbstractBlock represent a block as SirTrevor knows it. It can be easily mapped to a Doctrine ORM entity, for this for already put some annotations.

Rendering the editor

To render the editor, put in a Twig template:

You must pass to this template a blocks variable , containing a collection of AbstractBlock. Moreover, using a is_editable variable, you can decide whether to render a content editable with SirTrevor or just to render the blocks as plain old HTML.

By default we use the theme EdsiTechSirTrevorBundle:Render:_blocks_theme.html.twig.
You can change it via Bundle config:

Saving blocks

Blocks will be re-send to your controller, via POST. To handle those, you should use the provided edsi_tech_sir_trevor.handler.block_handler service. It will read the Request and return you an array of EdsiTech\SirTrevorBundle\Model\EditedBlock.

Bonus

Loading Bar

It includes a progress bar for editor loading. Available using Pace.

Flash messages

Request flash messages are displayed as nice messages powered by HubSport Messenger

Controller example:

"back" button

The bar on top added by this bundle can include a "back" button. Just provide the URL it should point to in your controller:

Even more buttons

You can provide more buttons/HTML to add to the bar on top of the page via save_bar_buttons:

Full working example

The controller:

The template:

Configuration

Allowed blocks

By defaults not all SirTrevor blocks are enabled, you can modify it in bundle configuration:

Themes

When the content is rendered, we are using a blocks_theme to determine the HTML for each block (in a manner pretty similar to Symfony2 Form theme). A default implementation is included; if you want to customize it, you can set your own Twig template in configuration.

All blocks are rendered within a render_template you can also override.

Adding an extra CSS or JS file

You can inject another JS file, loaded after included JS libraries but before the editor is initialized. A common use case is to add some SirTrevor blocks.

In the same manner, you can also add a CSS file, that will be included after all ours stylesheets.

Going further

Getting Editor instance

You can retrieve the SirTrevor instance in JS by doing SirTrevor.getInstance()


All versions of sir-trevor-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ~5.4
symfony/symfony Version ~2.3
doctrine/orm Version ~2.2,>=2.2.3
doctrine/doctrine-bundle Version ~1.2
twig/extensions Version ~1.0
symfony/assetic-bundle Version ~2.3
erusev/parsedown Version ~1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package edsi-tech/sir-trevor-bundle contains the following files

Loading the files please wait ....