Download the PHP package seiler/shortcoder without Composer

On this page you can find all versions of the php package seiler/shortcoder. 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 shortcoder

Shortcoder

Latest Version Build Status Coverage Status Quality Score

Shortcoder helps you to build your own shortcodes system in your PHP application with ease.

This package is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Requirements

The following versions of PHP are supported by this version.

Installation

Via Composer

Usage

  1. Create a new Shortcoder instance:

  2. Add your shortcodes:

  3. Parse some text:

Documentation

A shortcode is defined by a pattern, a replacement and an optional regex flag. A shortcode pattern usually contains one or more wildcards to represent the content to be preserved between the pattern and the replacement.

Shortcoder allows you to add() shortcodes with the following syntaxes.

The flush() and set() methods are useful for flushing the current shortcodes stack. The set() method also adds new shortcodes after a flush.

Because set() is called when you create a new Shortcoder instance, all of the add() syntaxes are available in the constructor as well.

The parse() method takes any string as input and parses it with the stacked shortcodes.

Method chaining

The add(), set() and flush() methods supports method chaining.

Multiple wildcards

Wildcards are replaced by regular expression powered catch-alls when adding shortcodes to the stack. It means that when you add multiple wildcards, Shortcoder will match each wildcard in a pattern to its corresponding position in the replacement.

When a wildcard directly follows another wildcard in a pattern, only the first word of the matching expression will be assigned to the first wildcard, the remaining of the expression will be catched as the second wildcard.

Regular expressions

When setting the third argument of the add() method (or the regex attribute of the shortcode) to any 'true' value, Shortcoder will handle pattern and replacement as raw regular expressions, which can be useful for more advanced usages.

Backreferences

When forcing position of some of the backreferences in a shortcode's replacement, Shortcoder will guess what to do with the remaining wildcards.

Markdown compatibility

In case you're using Shortcoder to render some HTML blocks, just append markdown=1 in your replacement attributes to support Markdown Extra. Here's an example with Parsedown Extra:

With CommonMark, it's a little bit more tricky. Rules are not the same for inline and block level elements. Example of an inline level element with the league/commonmark implementation:

And here's the same example, but this time with a block level element:

Testing

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of shortcoder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
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 seiler/shortcoder contains the following files

Loading the files please wait ....