Download the PHP package barbashin-andrey/shortcode without Composer
On this page you can find all versions of the php package barbashin-andrey/shortcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download barbashin-andrey/shortcode
More information about barbashin-andrey/shortcode
Files in barbashin-andrey/shortcode
Download barbashin-andrey/shortcode
More information about barbashin-andrey/shortcode
Files in barbashin-andrey/shortcode
Vendor barbashin-andrey
Package shortcode
Short Description PHP shortcodes handler
License https://github.com/WordPress/WordPress/blob/master/wp-includes/shortcodes.php#L63
Package shortcode
Short Description PHP shortcodes handler
License https://github.com/WordPress/WordPress/blob/master/wp-includes/shortcodes.php#L63
Please rate this library. Is it a good library?
Informations about the package shortcode
PHP shortcodes handler
Based on Wordpress sources for my personal purposes
Example
require_once __DIR__.'/vendor/autoload.php';
function sampleFunc($params) {
$atts = $params["atts"];
$args = $params["args"];
$name = $atts["name"];
$age = $args["age"];
return "<p>Name: $name</p><p>Age: $age</p>";
}
$content = '
<p>Some other elements</p>
[sample name="Alex"]
<p>Some other elements</p>
';
$handler = new ShortcodeHandler();
$handler->addShortcode('sample', 'sampleFunc', ['age' => 18]);
$content = $handler->handle($content);
print_r($content);
Result:
<p>Some other elements</p>
<p>Name: Alex</p><p>Age: 18</p>
<p>Some other elements</p>
Installation
Via composer:
composer require barbashin-andrey/shortcode
All versions of shortcode with dependencies
PHP Build Version
Package Version
No informations.
The package barbashin-andrey/shortcode contains the following files
Loading the files please wait ....