mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 17:34:26 +02:00
Merge branch 'support/5'
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966)
|
|
1
changelog/972.md
Normal file
1
changelog/972.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- Fix Smarty::assign() not returning $this when called with an array as first parameter [#972](https://github.com/smarty-php/smarty/pull/972)
|
@@ -15,7 +15,7 @@ php utilities/update-smarty-version-number.php $1
|
|||||||
git add changelog CHANGELOG.md src/Smarty.php
|
git add changelog CHANGELOG.md src/Smarty.php
|
||||||
git commit -m "version bump"
|
git commit -m "version bump"
|
||||||
|
|
||||||
git checkout master
|
git checkout support/5
|
||||||
git pull
|
git pull
|
||||||
git merge --no-ff "release/$1"
|
git merge --no-ff "release/$1"
|
||||||
git branch -d "release/$1"
|
git branch -d "release/$1"
|
||||||
|
@@ -109,7 +109,7 @@ class Data
|
|||||||
foreach ($tpl_var as $_key => $_val) {
|
foreach ($tpl_var as $_key => $_val) {
|
||||||
$this->assign($_key, $_val, $nocache, $scope);
|
$this->assign($_key, $_val, $nocache, $scope);
|
||||||
}
|
}
|
||||||
return;
|
return $this;
|
||||||
}
|
}
|
||||||
switch ($scope ?? $this->getDefaultScope()) {
|
switch ($scope ?? $this->getDefaultScope()) {
|
||||||
case self::SCOPE_GLOBAL:
|
case self::SCOPE_GLOBAL:
|
||||||
|
@@ -42,4 +42,15 @@ class AssignTest extends PHPUnit_Smarty
|
|||||||
$this->smarty->assign(array('foo' => 'bar', 'foo2' => 'bar2'));
|
$this->smarty->assign(array('foo' => 'bar', 'foo2' => 'bar2'));
|
||||||
$this->assertEquals('bar bar2', $this->smarty->fetch('eval:{$foo} {$foo2}'));
|
$this->assertEquals('bar bar2', $this->smarty->fetch('eval:{$foo} {$foo2}'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that assign returns this.
|
||||||
|
*/
|
||||||
|
public function testAssignReturnsThis()
|
||||||
|
{
|
||||||
|
$this->assertEquals(
|
||||||
|
'data',
|
||||||
|
$this->smarty->assign(['dummy' => 'data'])->fetch('eval:{$dummy}')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user