Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #112 Add syntax for late-bound viewdata eval
inside a ${expr} or #stmt you can have #foo.bar terms that are passed to object Eval("foo.bar") it may also be followed by a format string, like ${#price '#,##0.00'} or ${#terms.due "MM/dd yyyy"} which result in a call to string Eval("price", "{0:#,##0.00}") because this calls the asp.net mvc ViewData.Eval method, to work in monorail it will require adding an implementation of object Eval(string expession) and string Eval(string expression, string format) to the base spark view class. git-svn-id: http://dev.dejardin.org/svn/spark/trunk@298 0f556331-6e29-4ecb-911f-9ab3f335dbaa
- Loading branch information
Showing
14 changed files
with
210 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/Spark.Tests/Spark.Tests.Views/Home/LateBoundEvalResolvesViewData.spark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| ||
<p>${#alpha}</p> | ||
<p>${H(#alpha)}</p> | ||
# Output.Write(#beta); | ||
<p>4${#nosuchthing}2</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/Spark.Web.Mvc.Tests/AspNetMvc.Tests.Views/Home/EvalWithAnonModel.spark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| ||
<p>${#Foo} ${#Bar.Text}</p> | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
src/Spark.Web.Mvc.Tests/AspNetMvc.Tests.Views/Home/EvalWithFormatString.spark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| ||
<p>${#cost "#,##0.00"}</p> | ||
|
||
<p>${#terms.Due 'yyyy/MM/dd'}</p> | ||
|
3 changes: 3 additions & 0 deletions
3
src/Spark.Web.Mvc.Tests/AspNetMvc.Tests.Views/Home/EvalWithViewDataModel.spark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
| ||
<viewdata model="Spark.Web.Mvc.Tests.Models.Comment"/> | ||
<p>${#Text}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters