Download the PHP package schibsted-tech-polska/php-content-stylizer without Composer

On this page you can find all versions of the php package schibsted-tech-polska/php-content-stylizer. 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 php-content-stylizer

Content Stylizer - PHP

This library was written to support converting text objects introduced in Schibsted Media Platform's article format version 5 into HTML in PHP.

To use it you have to create Stylizer instance and define a list of supported tags in one of two ways. Then you can use getHtml method passing text and an array with markups and receiving HTML code as an output.

Basic usage:

Defining tags list (method 1):

Defining tags list (method 2):

Converting text into HTML:

Parameters inside tags:

Both beginning and end attribute of any tag can be defined using string or anonymous function. The second way allows us to add some logic to HTML creation process and to use parameters passed in markup objects.

Let's define link tag:

Then we can use link markup:

Note that $params object contains all attributes of markup one except length, offset and type which means that in this example it contains only uri parameter.

Singleton tags:

There is also a way of defining singleton tags, e.g. line breaks - Stylizer will treat as singleton every tag without end parameter defined.

It can be defined in an array passed to constructor:

We can define it using addTag method as well:

If we define br tag, Stylizer will also add line break in every place in text before PHP_EOL sign occurence.

Tests:

This library contains unit tests and some other CI tools which can be easily run using Node.js. To do it install Node.js environment, then Grunt CLI:

and project dependencies:

To start testing just simply execute:


All versions of php-content-stylizer with dependencies

PHP Build Version
Package Version
Requires ext-mbstring Version *
php Version >=5.6.0
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 schibsted-tech-polska/php-content-stylizer contains the following files

Loading the files please wait ....