mirror of
https://github.com/friendica/friendica
synced 2024-12-23 16:40:17 +00:00
template proc: avoid a notice and allow template name to include to be passed with a variable value
This commit is contained in:
parent
a26ce7c56b
commit
c462ed9fc5
1 changed files with 9 additions and 1 deletions
|
@ -116,7 +116,15 @@
|
|||
* {{ inc <templatefile> [with $var1=$var2] }}{{ endinc }}
|
||||
*/
|
||||
private function _replcb_inc($args){
|
||||
list($tplfile, $newctx) = array_map('trim', explode("with",$args[2]));
|
||||
if (strpos($args[2],"with")) {
|
||||
list($tplfile, $newctx) = array_map('trim', explode("with",$args[2]));
|
||||
} else {
|
||||
$tplfile = trim($args[2]);
|
||||
$newctx = null;
|
||||
}
|
||||
|
||||
if ($tplfile[0]=="$") $tplfile = $this->_get_var($tplfile);
|
||||
|
||||
$this->_push_stack();
|
||||
$r = $this->r;
|
||||
if (!is_null($newctx)) {
|
||||
|
|
Loading…
Reference in a new issue