-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
103 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<x-rapidez::productlist field="{{ $condition->attribute }}.keyword" :value="explode(', ', $condition->value)" :size="$options['products_count']"/> | ||
<x-rapidez::productlist field="{{ $condition->attribute }}.keyword" :value="explode(', ', $condition->value)" :size="$options->products_count"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Rapidez\Core\ContentVariables; | ||
|
||
class Media | ||
{ | ||
public function __invoke($content) | ||
{ | ||
return preg_replace('/{{media url=("|"|\')(.*?)("|"|\')}}/m', config('rapidez.media_url').'/${2}', $content); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Rapidez\Core\ContentVariables; | ||
|
||
class Store | ||
{ | ||
public function __invoke($content) | ||
{ | ||
return preg_replace('/{{store (url|direct_url)=("|"|\')(.*?)("|"|\')}}/m', '/${3}', $content); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Rapidez\Core\ContentVariables; | ||
|
||
class Widget | ||
{ | ||
public function __invoke($content) | ||
{ | ||
return preg_replace_callback('/{{widget type="(.*?)" (.*?)}}/m', function ($matches) { | ||
[$full, $type, $parameters] = $matches; | ||
preg_match_all('/(.*?)="(.*?)"/m', $parameters, $parameters, PREG_SET_ORDER); | ||
foreach ($parameters as $parameter) { | ||
[$full, $parameter, $value] = $parameter; | ||
$options[trim($parameter)] = trim($value); | ||
} | ||
|
||
if (!isset($type)) { | ||
return ''; | ||
} | ||
|
||
$widgetClass = config('rapidez.widgets.'.$type); | ||
|
||
if (!class_exists($widgetClass) && !app()->environment('production')) { | ||
return '<hr>'.__('Widget not implemented (:type).', compact('type')).'<hr>'; | ||
} | ||
|
||
return (new $widgetClass((object)$options))->render(); | ||
}, $content); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters