Skip to content

Commit 3293a87

Browse files
authored
Remove unused attributes from config_load (#1004)
fixes #993
1 parent 8d53d3c commit 3293a87

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

docs/designers/language-builtin-functions/language-function-config-load.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
|----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1010
| file | Yes | The name of the config file to include |
1111
| section | No | The name of the section to load |
12-
| scope | no | How the scope of the loaded variables are treated, which must be one of local, parent or global. local means variables are loaded into the local template context. parent means variables are loaded into both the local context and the parent template that called it. global means variables are available to all templates. |
1312

1413

1514
## Examples

src/Compile/Tag/ConfigLoad.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ class ConfigLoad extends Base {
4343
* @var array
4444
* @see BasePlugin
4545
*/
46-
protected $optional_attributes = ['section', 'scope'];
46+
protected $optional_attributes = ['section'];
4747

4848
/**
4949
* Attribute definition: Overwrites base class.
5050
*
5151
* @var array
5252
* @see BasePlugin
5353
*/
54-
protected $option_flags = ['nocache', 'noscope'];
54+
protected $option_flags = [];
5555

5656
/**
5757
* Compiles code for the {config_load} tag
@@ -66,9 +66,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter =
6666
{
6767
// check and get attributes
6868
$_attr = $this->getAttributes($compiler, $args);
69-
if ($_attr['nocache'] === true) {
70-
$compiler->trigger_template_error('nocache option not allowed', null, true);
71-
}
69+
7270
// save possible attributes
7371
$conf_file = $_attr['file'];
7472
$section = $_attr['section'] ?? 'null';

0 commit comments

Comments
 (0)