This repository is snippet template. Use it when you create a new snippet repository. Here should be placed a description of the plugin. All texts below are examples, replace them with real information.
- PHP >= 5.6
- (MODX)EvolutionCMS >= 1.1
- (MODX)EvolutionCMS.libraries.ddTools >= 0.59
Just run the following PHP code in your sources or Console:
// Include (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
$modx->getConfig('base_path')
. 'assets/libs/ddInstaller/require.php'
);
// Install (MODX)EvolutionCMS.snippets.ddStartSnippet
\DDInstaller::install([
'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddStartSnippet',
]);- If
ddStartSnippetis not exist on your site,ddInstallerwill just install it. - If
ddStartSnippetis already exist on your site,ddInstallerwill check it version and update it if needed.
- Snippet name:
ddStartSnippet. - Description:
<b>1.0</b> Snippet description.. - Category:
Core. - Parse DocBlock:
no. - Snippet code (php): Insert content of the
ddStartSnippet_snippet.phpfile from the archive.
- Create a new folder
assets/snippets/ddStartSnippet/. - Extract the archive to the folder (except
ddStartSnippet_snippet.php).
-
someParam1- Description: Parameter description.
- Valid values:
stringinteger
- Required
-
someParam2- Description: Parameter description.
- Valid values:
01
- Default value: —
-
outputterParams- Description: Parameters to be passed to the specified outputter.
- Valid values:
stringJsonObject— as JSONstringHjsonObject— as HJSONstringQueryFormatted— as Query string- It can also be set as a native PHP object or array (e. g. for calls through
\DDTools\Snippet::runSnippetor$modx->runSnippet):arrayAssociativeobject
- Default value: —
-
outputterParams->tpl- Description: Some template.
- Available placeholders:
[+somePlaceholder1+]— placeholder 1 description[+somePlaceholder2+]— placeholder 2 description
- Available placeholders:
- Valid values:
stringChunkNamestring— use inline templates starting with@CODE:
- Required
- Description: Some template.
-
outputterParams->placeholders- Description: Additional data has to be passed into the
outputterParams->tpl.- Nested objects and arrays are supported too:
{"someOne": "1", "someTwo": "test" }=>[+someOne+], [+someTwo+].{"some": {"a": "one", "b": "two"} }=>[+some.a+],[+some.b+].{"some": ["one", "two"] }=>[+some.0+],[+some.1+].
- Nested objects and arrays are supported too:
- Valid values:
object - Default value: —
- Description: Additional data has to be passed into the
All examples are written using HJSON, but if you want you can use vanilla JSON instead.
Some example description.
// Some exmaple code
// Include (MODX)EvolutionCMS.libraries.ddTools
require_once(
$modx->getConfig('base_path')
. 'assets/libs/ddTools/modx.ddtools.class.php'
);
// Run (MODX)EvolutionCMS.snippets.ddStartSnippet
\DDTools\Snippet::runSnippet([
'name' => 'ddStartSnippet',
'params' => [
'someParam1' => 'Some param value',
],
]);