Luke Lancaster
5de8b39d5c
Merge pull request #1 from RoundingWellOS/fix/continue_in_switch
...
Uses `break` in switch statements for php 7.3 upgrade
2019-04-10 10:47:30 -05:00
Luke Lancaster
ace6b1a16b
Uses break
in switch statements for php 7.3 upgrade
2019-04-10 10:36:22 -05:00
Behrooz Shabani
38c743f79b
Merge pull request #164 from mAAdhaTTah/bugfix/mustache-context-switch
...
Fix context switching for mustache blocks
2016-12-27 10:15:36 +01:00
mAAdhaTTah
a07d25d6a3
Fix context switching for mustache blocks
...
When you switch into a mustache block, an object shouldn't be iterated
over. Associative arrays are closer to objects than lists, so their
behavior should be more like objects.
2016-12-26 21:19:24 -05:00
Behrooz Shabani
b85cee07ea
Merge pull request #163 from mAAdhaTTah/bugfix/mustache-compatibility
...
Add failing test for Mustache-style `if` blocks
2016-12-12 14:51:02 +01:00
mAAdhaTTah
c25b7ee150
Add conditional to check if section
...
This was causing an issue when the section name was also used as a
variable in the block. When walking back up the block to find the open
tag, because it only checked if the name matched, the parser would
see the variable usage as the opening block and drop the rest of the
block. This checks explicitly whether it's a section or inverted block
before doing the left/right trim logic.
2016-12-12 08:05:58 -05:00
mAAdhaTTah
7aad4f30e3
Add failing test for Mustache-style if
blocks
2016-12-11 21:21:22 -05:00
André Glatzl
27e9e1c3b2
Improve extensibility of Template
2016-12-09 09:21:59 +01:00
behrooz shabani (everplays)
e5c03d3b01
properly pop the context for fn and inverse callbacks
...
fixes #160 .
2016-11-16 21:52:19 +01:00
behrooz shabani (everplays)
198faa48d6
more php 5.3 syntax fixes
2016-07-31 12:31:23 +02:00
behrooz shabani (everplays)
27898aef88
fix php 5.3
2016-07-31 12:26:10 +02:00
Behrooz Shabani
fe4e79ed83
Merge pull request #137 from stevejordan/if_unless_depth_correction
...
Updates if and unless helper behavior for handlebars 4
2016-07-31 12:16:29 +02:00
Behrooz Shabani
b8a8129855
Merge pull request #147 from hamidr/master
...
Merge "develop" branch into "master"
2016-07-31 12:08:35 +02:00
hamidr
86ebab9dba
Merge remote-tracking branch 'origin/develop'
2016-07-31 14:30:53 +04:30
Behrooz Shabani
37b377b9df
Merge pull request #136 from cblanquera/feature-register-helper-2
...
Feature: registerHelper()
2016-07-30 11:04:30 +02:00
Behrooz Shabani
1a0d4dc772
Merge pull request #146 from hfhchan/master
...
Fix: Don't re-escape variables that are already safe
2016-07-29 19:37:54 +02:00
hfhchan
dfb62e42cc
Fix scoping error
2016-07-30 01:31:55 +08:00
hfhchan
07d8542e3b
Fix syntax error
2016-07-30 01:18:50 +08:00
hfhchan
5222c6dff1
Add tests for passing SafeString as
2016-07-30 01:14:21 +08:00
hfhchan
402f970b77
Don't re-escape variables that are already safe
2016-07-28 18:06:50 +08:00
Behrooz Shabani
a00af06cac
Merge pull request #143 from Skyscanner/ttl-feature
...
Implementation of TTL for caching
2016-07-26 10:51:07 +02:00
Maria Sormanova
3a25d9bf17
added versioning to prevent breaking existing projects
2016-07-26 10:43:18 +02:00
Maria Sormanova
51f8a3056b
Implementation of TTL for caching
2016-07-25 16:14:39 +02:00
Steve Jordan
909df9ab58
Updates if and unless helper behavior for handlebars 4
...
handlebars.js 4.0.0 changed the depth behaviour when using the if and
unless conditionals - https://github.com/wycats/handlebars.js/issues/1028
This commit changes the handlebars.php helpers to match.
2015-10-26 11:48:28 +00:00
Christian Blanquera
08ad533e81
case for the right String Class
...
Not sure where i got StringWrapper from. We now don’t need to case for
this in the `registerHelper()` method
2015-09-26 20:03:52 +08:00
Christian Blanquera
1ba7cdf108
added case descriptions and used an int example
2015-09-23 23:34:42 +08:00
Christian Blanquera
407732cef3
better registerHelper Tests
2015-09-23 23:23:53 +08:00
Christian Blanquera
08f4328f9d
phpcs
...
files i made no changes to, but got cs errors on.. not sure why. Just
let me know what the protocol is for this one.
2015-09-21 20:23:20 +08:00
Christian Blanquera
0070ad79c0
phpcs approval
...
“oh the spacing!”
2015-09-21 18:49:08 +08:00
Christian Blanquera
33c76738b4
Added registerHelper
...
I did it in such a way where I’m not messing with the other methods or
classes to get what I wanted.
I realize that there maybe no need for the child context, however when
trying a permutation of
```
'fn' => function($data = null) use($context, $template) {
$context->push($context->last());
if(is_array($data)) {
$context->push($data);
}
$template->setStopToken('else');
$buffer = $template->render($context);
$template->setStopToken(false);
$template->discard($context);
if(is_array($data)) {
$context->pop();
}
$context->pop();
return $buffer;
}
```
It didn’t parse the `../../../test` correctly in the test. I figured
that the ChildContext is a nice pattern overall and doesn’t interfere
with the rest of the package anyways…
2015-09-21 17:50:00 +08:00
Christian Blanquera
57d00e6e82
What to expect...
...
We should also probably check for looping capabilities as well.
2015-09-21 17:49:17 +08:00
fzerorubigd
5e1db1d1c7
Merge pull request #135 from JustBlackBird/php7_string
...
PHP7 String keyword
2015-08-07 02:46:36 +04:30
Dmitriy Simushev
97b5338a50
Add PHP7 to build matrix
2015-08-06 10:46:13 +00:00
Dmitriy Simushev
33ec96a1b4
Replace String class with StringWrapper one
2015-08-06 10:45:25 +00:00
fzerorubigd
a47d7e0fb2
Merge pull request #130 from JustBlackBird/fix_var_export
...
Fix exception message in Context::_findVariableInContext
2015-07-14 22:38:50 +04:30
Dmitriy Simushev
912cc286fa
Fix exception message in Context::_findVariableInContext
...
Fixes #129
2015-07-14 18:03:01 +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
2c78af65e0
Add tests for missed Mustache helpers
...
This is the missed test case for #121
2015-06-23 20:57:29 +00: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
fzerorubigd
071793118a
Merge pull request #124 from thormeier/partial-support-and-error-reporting
...
Partial support and error reporting
2015-06-20 10:28:40 +04:30
Pascal Thormeier
6ef6b7bc08
Remove last var_export statements
...
Got overlooked while refactoring
2015-06-19 11:43:58 +02: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
fzerorubigd
959834be09
Merge pull request #123 from Zemistr/master
...
Added support for class with __toString method as a context variable.
2015-06-08 09:26:41 +04:30