Commit Graph

74 Commits

Author SHA1 Message Date
hfhchan
402f970b77 Don't re-escape variables that are already safe 2016-07-28 18:06:50 +08:00
Dmitriy Simushev
33ec96a1b4 Replace String class with StringWrapper one 2015-08-06 10:45:25 +00:00
Dmitriy Simushev
10dbe6442e Merge pull request #127 from thormeier/partial-support-and-error-reporting
Fix handling of named arguments in partials
2015-06-30 21:02:40 +03:00
Pascal Thormeier
83199fbd65 Remove unnecessary if statement 2015-06-30 10:35:58 +02:00
Pascal Thormeier
2e1b67208d Fix handling of named arguments in partials
Also fix tests that weren't even executed
2015-06-29 17:16:59 +02:00
Dmitriy Simushev
f3067cb41a Merge pull request #121 from mmontagna/master
Fixes a incompatibility with handlebars.js
2015-06-23 23:46:56 +03:00
Pascal Thormeier
15af0f8e52 Remove var_export where unnecessary 2015-06-18 22:56:00 +02:00
Pascal Thormeier
9ebacc28ae Use Arguments class instead of regex 2015-06-17 23:57:12 +02:00
Pascal Thormeier
e1956be453 CS fixes 2015-06-17 16:11:50 +02:00
Pascal Thormeier
0111689f47 Fix and add tests
Also use var_export in exceptions in case array/object/etc get passed
2015-06-17 15:50:10 +02:00
Pascal Thormeier
a4b6f9627a Enable argument support in partials
Create own context if there are arguments and take values from context
where partial was rendered in. Also allow strings with `=` inside
arguments.
2015-06-17 14:19:57 +02:00
Pascal Thormeier
0a908fb6a1 Improve error reporting in case of exception
Make Exception messages more verbose
2015-06-17 14:18:32 +02:00
Martin Zeman
23076d68e5 Added support for class with __toString method as a context variable. 2015-06-07 23:09:14 +02:00
Marco Montagna
083458d839 Don't enforce strict search for variables in block exprs 2015-06-03 14:33:22 -07:00
Jeff Turcotte
69d4efe259 Added custom template class option 2014-12-16 18:35:16 -05:00
David Cramer
666e44beb5 Update Template.php
Update Template.php

added test case
2014-11-18 07:36:26 +02:00
Jeff Turcotte
9eb7f952d2 Added getCurrentTokenTree to get a token's tree within a helper 2014-11-10 15:05:34 -05:00
Dmitriy Simushev
e863d7af80 Make subexpressions play nice with context 2014-09-15 09:19:21 +00:00
Dmitriy Simushev
17dc20203b Improve arguments parsing 2014-09-02 09:34:38 +00:00
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
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
Jeff Turcotte
c166af1ed7 Added helper interface and converted all built in helpers 2014-03-26 21:59:57 -04:00
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
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)
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
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
fzerorubigd
939c58bbee
Some test improvement and add an ArrayLoader 2014-02-26 20:26:51 +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
Dmitriy Simushev
b4c019372b Add segment-literal notation for expressions 2014-02-05 09:07:02 +00:00
Dmitriy Simushev
79373a193a Add \Handlebars\SafeString class 2014-02-03 08:50:01 +00:00
Dmitriy Simushev
b6a903fee8 Use handlebars escape function for helpers' results 2014-02-01 10:44:23 +00:00
behrooz shabani (everplays)
3a3ab36c5f escape helpers. fixes #42 2014-02-01 11:29:52 +03:30
Dmitriy Simushev
93884fb26b Add "else" block to "each" helper 2014-01-23 11:44:34 +00:00
Chris Gray
4d5e433e61 Fixed formating. 2014-01-20 11:14:53 -06:00
Chris Gray
a44777f52f Added Tests and changed internal representation of quoted string literals from strangely quoted string to an instance of \Handlebars\String 2014-01-20 09:57:16 -06:00
Chris Gray
49dcbb2573 Changed Internal representation of quoted string literals to be an instance of \Handlebars\String instead of strangely quoted string. 2014-01-20 09:04:31 -06:00
Chris Gray
1bbe32b56e Updated docblock 2014-01-19 21:06:22 -06:00
Chris Gray
415e642351 Fixed to conform to coding standards 2014-01-17 00:46:39 -06:00
Chris Gray
da1cf77c58 Added string literal support in Context::get and added Template::parseArguments to ease plugin development 2014-01-16 23:28:48 -06:00
behrooz shabani (everplays)
94fbc01217 first part is going to be used, so ignore the rest 2013-12-13 23:09:06 +03:30
behrooz shabani (everplays)
df6ecac7df extracted processing of sections from variable processing 2013-12-13 23:04:31 +03:30
behrooz shabani (everplays)
300f44e8c6 fixed a typo 2013-12-13 22:29:54 +03:30