Skip to content

Commit

Permalink
Version 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronef committed May 13, 2020
2 parents 968d220 + 6faddc5 commit a8bdc45
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# (MODX)EvolutionCMS.snippets.ddRunSnippets changelog


## Version 3.1 (2020-05-14)
* \+ Parameters → `snippets->{$snippetName}->{$paramName}`: As opposed to standard CMS calling you can pass not only string parameters to the snippet, any types are supported.


## Version 3.0 (2020-05-13)
* \* Attention! Backward compatibility is broken.
* \* Attention! (MODX)EvolutionCMS.libraries.ddTools >= 0.35.1 is required (not tested in older versions).
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# (MODX)EvolutionCMS.snippets.ddRunSnippets changelog


## Version 3.1 (2020-05-14)
* \+ Параметры → `snippets->{$snippetName}->{$paramName}`: В отличие от стандартного вызова CMS вы можете передавать не только строковые параметры, поддерживаютя любые типы.


## Версия 3.0 (2020-05-13)
* \* Внимание! Обратная совместимость нарушена.
* \* Внимание! Требуется (MODX)EvolutionCMS.libraries.ddTools >= 0.35.1 (не тестировался с более старыми версиями).
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See the documentation for a more complete picture.
Elements → Snippets: Create a new snippet with the following data:

1. Snippet name: `ddRunSnippets`.
2. Description: `<b>3.0</b> Snippet runs necessary snippets with necessary params.`.
2. Description: `<b>3.1</b> Snippet runs necessary snippets with necessary params.`.
3. Category: `Core`.
4. Parse DocBlock: `no`.
5. Snippet code (php): Insert content of the `ddRunSnippets_snippet.php` file from the archive.
Expand Down Expand Up @@ -51,7 +51,8 @@ Elements → Snippets: Create a new snippet with the following data:
* Desctription: A snippet parameter, when the key is the parameter name and the value is the parameter value.
* Use `[+snippetName+]` for substitution by any previous snippet execution result in the parameter name or value (where `snippetName` is the snippet name).
* Or use `[+snippetAlias+]` if specified (e. g. `docs` if the snippet name set as `Ditto=docs`).
* Valid values: `string`
* Valid values:
* `mixed` — as opposed to standard CMS calling you can pass not only string parameters to the snippet, any types are supported
* Default value: —

* `tpl`
Expand Down
5 changes: 3 additions & 2 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Элементы → Сниппеты: Создайте новый сниппет со следующими параметрами:

1. Название сниппета: `ddRunSnippets`.
2. Описание: `<b>3.0</b> Сниппет запускает необходимые сниппеты с необходимыми параметрами.`.
2. Описание: `<b>3.1</b> Сниппет запускает необходимые сниппеты с необходимыми параметрами.`.
3. Категория: `Core`.
4. Анализировать DocBlock: `no`.
5. Код сниппета (php): Вставьте содержимое файла `ddRunSnippets_snippet.php` из архива.
Expand Down Expand Up @@ -51,7 +51,8 @@
* Описание: Параметр сниппета, где ключ — имя параметра, значение — значение параметра.
* Используйте `[+snippetName+]` для замены любым предыдущим результатом выполнения сниппета в имени параметра или значении (где `snippetName` — имя сниппета).
* Либо используйте псевдоним `[+snippetAlias+]`, если задан (например, `docs`, если имя сниппета задано как `Ditto=docs`).
* Допустимые значения: `string`
* Допустимые значения:
* `mixed` — в отличие от стандартного вызова CMS вы можете передавать не только строковые параметры, поддерживаютя любые типы
* Значение по умолчанию: —

* `tpl`
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dd/evolutioncms-snippets-ddrunsnippets",
"type": "modxevo-snippet",
"version": "3.0.0",
"version": "3.1.0",
"description": "Snippet runs necessary snippets with necessary params.",
"keywords": [
"modx",
Expand Down
5 changes: 3 additions & 2 deletions ddRunSnippets_snippet.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* ddRunSnippets
* @version 3.0 (2020-05-13)
* @version 3.1 (2020-05-14)
*
* @see README.md
*
Expand Down Expand Up @@ -78,6 +78,7 @@

//If parameter value contains placeholders
if (
is_string($aSnippetParamValue) &&
strpos(
$aSnippetParamValue,
'[+'
Expand All @@ -90,7 +91,7 @@
'mergeAll' => false
]);

//Save parameter with the new name
//Save parameter with the new value
$aSnippetParams[$aSnippetParamName] = $aSnippetParamValue;
}
}
Expand Down

0 comments on commit a8bdc45

Please sign in to comment.