Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
5ab58ac1
Commit
5ab58ac1
authored
Jan 24, 2015
by
Ivan Lemeshev
Committed by
Alexander Makarov
Jan 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #6991: Fixed exception when using `{use class='yii\bootstrap\Nav' type='function'}`
parent
d8622223
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
CHANGELOG.md
extensions/smarty/CHANGELOG.md
+1
-0
ViewRenderer.php
extensions/smarty/ViewRenderer.php
+1
-1
ViewRendererTest.php
tests/unit/extensions/smarty/ViewRendererTest.php
+6
-0
use.tpl
tests/unit/extensions/smarty/views/use.tpl
+12
-0
No files found.
extensions/smarty/CHANGELOG.md
View file @
5ab58ac1
...
@@ -5,6 +5,7 @@ Yii Framework 2 smarty extension Change Log
...
@@ -5,6 +5,7 @@ Yii Framework 2 smarty extension Change Log
-----------------------
-----------------------
-
Bug #6845: Fixed incorrect implementation of
`{registerCssFile`
and
`{registerJsFile`
(TomassunGitHub, samdark)
-
Bug #6845: Fixed incorrect implementation of
`{registerCssFile`
and
`{registerJsFile`
(TomassunGitHub, samdark)
-
Bug #6991: Fixed exception when using
`{use class='yii\bootstrap\Nav' type='function'}`
(ivanlemeshev)
2.0.2 January 11, 2015
2.0.2 January 11, 2015
...
...
extensions/smarty/ViewRenderer.php
View file @
5ab58ac1
...
@@ -159,7 +159,7 @@ class ViewRenderer extends BaseViewRenderer
...
@@ -159,7 +159,7 @@ class ViewRenderer extends BaseViewRenderer
if
(
count
(
$methodInfo
)
===
2
)
{
if
(
count
(
$methodInfo
)
===
2
)
{
$alias
=
$methodInfo
[
1
];
$alias
=
$methodInfo
[
1
];
if
(
isset
(
$this
->
widgets
[
'functions'
][
$alias
]))
{
if
(
isset
(
$this
->
widgets
[
'functions'
][
$alias
]))
{
if
((
$methodInfo
[
0
]
===
'_widget_func'
)
&&
(
count
(
$args
)
===
2
))
{
if
((
$methodInfo
[
0
]
===
'_widget_func
tion
'
)
&&
(
count
(
$args
)
===
2
))
{
return
$this
->
widgetFunction
(
$this
->
widgets
[
'functions'
][
$alias
],
$args
[
0
],
$args
[
1
]);
return
$this
->
widgetFunction
(
$this
->
widgets
[
'functions'
][
$alias
],
$args
[
0
],
$args
[
1
]);
}
}
}
elseif
(
isset
(
$this
->
widgets
[
'blocks'
][
$alias
]))
{
}
elseif
(
isset
(
$this
->
widgets
[
'blocks'
][
$alias
]))
{
...
...
tests/unit/extensions/smarty/ViewRendererTest.php
View file @
5ab58ac1
...
@@ -92,6 +92,12 @@ class ViewRendererTest extends TestCase
...
@@ -92,6 +92,12 @@ class ViewRendererTest extends TestCase
$this
->
assertFalse
(
strpos
(
$content
,
'extends1 block'
)
!==
false
,
'extends1 block should not be there:'
.
$content
);
$this
->
assertFalse
(
strpos
(
$content
,
'extends1 block'
)
!==
false
,
'extends1 block should not be there:'
.
$content
);
}
}
public
function
testUse
()
{
$view
=
$this
->
mockView
();
$view
->
renderFile
(
'@yiiunit/extensions/smarty/views/use.tpl'
);
}
/**
/**
* @return View
* @return View
*/
*/
...
...
tests/unit/extensions/smarty/views/use.tpl
0 → 100644
View file @
5ab58ac1
{
use
class
=
'yii\helpers\Html'
}
{
use
class
=
'yii\bootstrap\Nav'
type
=
'function'
}
{
use
class
=
'yii\bootstrap\NavBar'
type
=
'block'
}
{
NavBar
brandLabel
=
$app
->
name
brandUrl
=
$app
->
homeUrl
options
=[
'class'
=>
'test'
]
}
{
Nav
options
=[
'class'
=>
'test2'
]
items
=[
[
'label'
=>
'Home'
,
'url'
=>
'http://example.com/'
]
]
}
{/
NavBar
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment