Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused attributes from config_load #1004

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
|----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| file | Yes | The name of the config file to include |
| section | No | The name of the section to load |
| 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. |


## Examples
Expand Down
8 changes: 3 additions & 5 deletions src/Compile/Tag/ConfigLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class ConfigLoad extends Base {
* @var array
* @see BasePlugin
*/
protected $optional_attributes = ['section', 'scope'];
protected $optional_attributes = ['section'];

/**
* Attribute definition: Overwrites base class.
*
* @var array
* @see BasePlugin
*/
protected $option_flags = ['nocache', 'noscope'];
protected $option_flags = [];

/**
* Compiles code for the {config_load} tag
Expand All @@ -66,9 +66,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter =
{
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
if ($_attr['nocache'] === true) {
$compiler->trigger_template_error('nocache option not allowed', null, true);
}

// save possible attributes
$conf_file = $_attr['file'];
$section = $_attr['section'] ?? 'null';
Expand Down
Loading