Fzerorubigd
8a669f3176
Merge pull request #79 from ulriklystbaek/patch-5
...
Update Context.php, Return null instead of empty string when the variable is not available in context
2014-08-28 14:26:04 +04:30
ulriklystbaek
122a8a9d7b
Update Context.php
...
Should return null instead of an empty string when context is not found. Handlebars.js returns undefined, which makes it possible to distict an empty string and not existing. (should not affect existing use, because null is handeled the same way as empty string)
2014-08-28 10:10:05 +02:00
Behrooz Shabani
c6f3e0fd5e
Merge pull request #75 from Mibew/named_arguments
...
Add named arguments parser
2014-08-20 23:15:37 +04:30
behrooz shabani (everplays)
07c49bbb3f
make sure that buffer is always a string
2014-08-20 13:08:33 +04:30
behrooz shabani (everplays)
35ea671fd7
fix 0 being treated as empty string, fixes #76
2014-08-20 10:14:02 +04:30
Dmitriy Simushev
92a3815d85
Add named arguments parser
2014-08-19 11:21:20 +00:00
fzerorubigd
84c6e3006c
fix #71
2014-07-11 21:05:26 +04:30
fzerorubigd
a9178d5f01
fix phpcs
2014-07-04 22:30:41 +04:30
fzerorubigd
0a35a913c2
add more test and fix a wrong test, also comment some not-used-at-all codes.
...
If need some of thease code back, create a test case for them.
2014-07-04 22:22:18 +04:30
fzerorubigd
a68318f4c5
Support whitespace deletion
...
Need more test :)
fixes #61
2014-07-04 03:36:14 +04:30
Fzerorubigd
cd8cec42a0
Merge pull request #70 from Mibew/tests_for_issue_69
...
Add a test case for issue #69
2014-07-03 21:36:13 +04:30
Dmitriy Simushev
ff6e3dfe14
Add a test case for issue #69
2014-07-03 16:53:49 +00:00
Fzerorubigd
813143cf1d
Merge pull request #69 from jslegers/master
...
Patch 2 for arrays that contain only one elements
2014-07-03 19:36:04 +04:30
John Slegers
182bfc9aea
Patch 2 for arrays that contain only one elements
...
For arrays that contain only one element, `(array_keys($tmp) == range(0, count($tmp) - 1)` always returns true.
`(array_keys($tmp) === range(0, count($tmp) - 1)` works as expected.
My local test environment = Linux Mint + PHP 5.4.
This patch is identical to https://github.com/XaminProject/handlebars.php/pull/66 , but applies to a different part of the code.
2014-07-03 16:53:22 +02:00
Behrooz Shabani
021ca5f018
Merge pull request #67 from Mibew/each_helper_single_key_test
...
Add a test case for #66
2014-07-02 23:10:47 +04:30
Dmitriy Simushev
c5d09bd13a
Add a test case for #66
2014-07-02 18:35:00 +00:00
Behrooz Shabani
bc56af2e83
Merge pull request #66 from jslegers/master
...
Fix for detecting assocc arrays with one item as list
2014-07-02 22:52:27 +04:30
John Slegers
9d0bb58d36
Adding author data
...
Adding author data
2014-07-02 19:08:39 +02:00
John Slegers
c28709eb76
Update EachHelper.php
...
For arrays that contain only one element, `(array_keys($tmp) == range(0, count($tmp) - 1)` always returns true.
`(array_keys($tmp) === range(0, count($tmp) - 1)` works as expected.
2014-07-02 18:59:58 +02:00
Behrooz Shabani
3c58c8eeed
Merge pull request #64 from Mibew/fix_quotes_extra_escape
...
Fix quotes extra escape
2014-06-24 20:30:02 +04:30
Dmitriy Simushev
a6955b83a9
Fix quotes extra escape
2014-06-24 14:42:22 +00:00
behrooz shabani (everplays)
93b6dd8cb6
fixes extra escaping of scalar arguments
2014-06-23 13:29:50 +04:30
Dmitriy Simushev
d92640890f
Add tests for extra arguments escape problem
2014-06-20 14:03:19 +00:00
behrooz shabani (everplays)
81f3efbb84
helpers with style of array(Object, methodName)
...
Previously we had them working. So for the sake's of backward
compatibility, they should be supported.
2014-03-27 12:03:35 +04:30
Behrooz Shabani
a8f7b4a7a7
Merge pull request #60 from jeffturcotte/master
...
Added helper interface and converted all built in helpers
2014-03-27 11:43:08 +04:30
Jeff Turcotte
c166af1ed7
Added helper interface and converted all built in helpers
2014-03-26 21:59:57 -04:00
behrooz shabani (everplays)
4e0ed3c7ae
more escaping related fixes
2014-03-21 03:29:31 +03:30
behrooz shabani (everplays)
d719bd12ca
don't eat up backslashes. fixes #59
2014-03-21 02:39:59 +03:30
behrooz shabani (everplays)
97201fe861
local merge of #56 PR. fixes 54
2014-03-20 22:55:05 +03:30
majortom731
ffcbecf346
Implemented proper treatment of brackets inside string arguments in subexpressions ( {{foo '(bar)'}} )
2014-03-17 23:01:30 +01:00
majortom731
5a58d27ad3
Added test for correctness of treatment of brackets inside string arguments ( {{foo '(bar)'}} )
2014-03-17 23:00:36 +01:00
majortom731
30f7afeb84
More code style / indentation fixes
2014-03-17 16:46:12 +01:00
majortom731
5257701669
Fixed indentation / code style
2014-03-17 16:41:54 +01:00
behrooz shabani (everplays)
7f6dcf6c3e
final touch on fixing missing copyright notices
2014-03-17 13:44:21 +03:30
behrooz shabani (everplays)
413585f9ce
Added missing copyright notices. fixes #57
2014-03-17 00:58:50 +03:30
majortom731
41722af86d
Added testHelperSubexpressions()
2014-03-12 19:39:05 +01:00
majortom731
4bc443e834
Added testHelperSubexpressions()
2014-03-12 19:34:15 +01:00
majortom731
3fc92fcdc5
Added support for subexpressions in helper calls. Not sure if Template.php is the best place to handle subexpressions...
2014-03-12 19:33:46 +01:00
majortom731
5c3ea257b7
Changed the internal 'if' helper such that it can test not only paths/variable names, but also numeric constants.
...
This will be helpful for subexpressions later, when testing numeric subexpressions return values,
eg: {{#if (eq 0 (mod @index 3))}}
Also added a test for this.
2014-03-12 17:00:09 +01:00
majortom731
d7a9844e93
Changed the internal 'if' helper such that it can test not only paths/variable names, but also numeric constants.
...
This will be helpful for subexpressions later, when testing numeric subexpressions return values,
eg: {{#if (eq 0 (mod @index 3))}}
Also added a test for this.
2014-03-12 16:59:54 +01:00
behrooz shabani (everplays)
da443c5fd5
added support for escaping tags. fixes #53
2014-03-08 14:50:08 +03:30
fzerorubigd
9c91ea7d64
add another test
2014-02-26 21:13:11 +03:30
fzerorubigd
939c58bbee
Some test improvement and add an ArrayLoader
2014-02-26 20:26:51 +03:30
Behrooz Shabani
3514a2b151
Merge pull request #51 from Mibew/each_special_variables
...
Each special variables
2014-02-25 22:40:26 +03:30
Dmitriy Simushev
39dd482df5
Add "@first" and "@last" values to "each" helper
2014-02-25 13:24:41 +00:00
Dmitriy Simushev
9d62ffd581
Use both "@index" and "@key" for associative arrays
2014-02-25 12:40:47 +00:00
Fzerorubigd
5b188ce19e
Merge pull request #48 from Mibew/auto_esc_vars_tests
...
Add tests for auto escape variables content
2014-02-05 23:10:31 +03:30
Dmitriy Simushev
478d28b20f
Add tests for auto escape variables content
2014-02-05 14:03:56 +00:00
Behrooz Shabani
40f0eb9b7b
Merge pull request #47 from Mibew/improved_ids
...
Add segment-literal notation for expressions
2014-02-05 13:11:12 +03:30
Dmitriy Simushev
b4c019372b
Add segment-literal notation for expressions
2014-02-05 09:07:02 +00:00