FEATURE: add support for shortcodes

This commit is contained in:
Michal Kváček
2016-10-02 16:28:12 +02:00
parent c4d4ac2bfe
commit b43e37fa83
5 changed files with 73 additions and 6 deletions
+4 -2
View File
@@ -3,6 +3,7 @@ namespace App\Helpers;
use App\Handlers\Contracts\AppHandler; use App\Handlers\Contracts\AppHandler;
use App\Models\Content; use App\Models\Content;
use Webwizo\Shortcodes\Facades\Shortcode;
/** /**
* Class PageRenderer * Class PageRenderer
@@ -33,7 +34,8 @@ class PageRenderer
*/ */
// get handler // get handler
$handler = new $page->module_handler; $handler = new $page->module_handler;
// render page
return $handler->render($page, $parameters); // render page
return Shortcode::compile($handler->render($page, $parameters));
} }
} }
+2 -1
View File
@@ -14,7 +14,8 @@
"watson/sitemap": "^2.0", "watson/sitemap": "^2.0",
"mcamara/laravel-localization": "^1.1", "mcamara/laravel-localization": "^1.1",
"franzose/closure-table": "^4.1", "franzose/closure-table": "^4.1",
"intervention/image": "^2.3" "intervention/image": "^2.3",
"webwizo/laravel-shortcodes": "1.0.4"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
Generated
+63 -2
View File
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "066078c74cc6b8d99111c0e9b4b385d6", "hash": "1d486fb23e76c7af1daf00bee207919c",
"content-hash": "1574402e32047ac8589b6fc08d6d744c", "content-hash": "957b49e5a2e691ad8dbc0e665a87d6c7",
"packages": [ "packages": [
{ {
"name": "classpreloader/classpreloader", "name": "classpreloader/classpreloader",
@@ -2855,6 +2855,67 @@
"sitemaps" "sitemaps"
], ],
"time": "2016-08-18 23:27:53" "time": "2016-08-18 23:27:53"
},
{
"name": "webwizo/laravel-shortcodes",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/webwizo/laravel-shortcodes.git",
"reference": "da0774fcba968b11591693cc55b28fabe7eaf047"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webwizo/laravel-shortcodes/zipball/da0774fcba968b11591693cc55b28fabe7eaf047",
"reference": "da0774fcba968b11591693cc55b28fabe7eaf047",
"shasum": ""
},
"require": {
"illuminate/contracts": "~5.2",
"illuminate/support": "~5.2",
"illuminate/view": "~5.2",
"php": "~5.5|~7.0"
},
"require-dev": {
"orchestra/testbench": "~3.2",
"phpunit/phpunit": "4.*",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "~2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"tests/TestCase.php"
],
"psr-4": {
"Webwizo\\Shortcodes\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Asif Iqbal",
"email": "webwizo@gmail.com",
"homepage": "http://www.webwizo.com",
"role": "Developer"
}
],
"description": "Wordpress like shortcodes for Laravel 5.2",
"homepage": "https://github.com/webwizo/laravel-shortcodes",
"keywords": [
"laravel",
"shortcodes",
"wordpress"
],
"time": "2016-08-25 06:02:46"
} }
], ],
"packages-dev": [ "packages-dev": [
+2
View File
@@ -162,6 +162,7 @@ return [
Franzose\ClosureTable\ClosureTableServiceProvider::class, Franzose\ClosureTable\ClosureTableServiceProvider::class,
\Watson\Sitemap\SitemapServiceProvider::class, \Watson\Sitemap\SitemapServiceProvider::class,
Intervention\Image\ImageServiceProvider::class, Intervention\Image\ImageServiceProvider::class,
Webwizo\Shortcodes\ShortcodesServiceProvider::class,
/* /*
* Application Service Providers... * Application Service Providers...
*/ */
@@ -220,6 +221,7 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class, 'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Shortcode' => Webwizo\Shortcodes\Facades\Shortcode::class,
], ],
@@ -8,8 +8,9 @@
basicEntities: false, basicEntities: false,
entities_greek: false, entities_greek: false,
entities_latin: false, entities_latin: false,
removePlugins: 'elementspath,about,scayt', removePlugins: 'about,scayt', //elementspath
extraPlugins: 'justify', extraPlugins: 'justify',
enterMode: CKEDITOR.ENTER_DIV,
toolbarGroups: [ toolbarGroups: [
{name: 'undo', groups: ['undo']}, {name: 'undo', groups: ['undo']},
{name: 'styles'}, {name: 'styles'},