forked from phalcon/cphalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Volt::callMacro (phalcon#11765)
* Fixed issue phalcon#11745 * Amended Volt tests * Small cleanup
- Loading branch information
1 parent
517596f
commit c2f3dc9
Showing
10 changed files
with
151 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- Tests for foreign keys cascade in the ORM | ||
- Tests for many-to-many relations | ||
- Tests for macros in Volt | ||
- Tests for +=, -=, *=, /=, ++, -- in Volt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{%- macro conditionaldate(condition, tdate, ttime, tz) -%} | ||
{%- if condition -%} from <br/>{{ tdate }}, {{ ttime }} {{ tz }}{%- endif -%} | ||
{%- endmacro -%} | ||
|
||
{%- set tdate = date('Y-m-d') -%} | ||
{%- set ttime = date('H:i') -%} | ||
{%- set tz = 'UTC' -%} | ||
|
||
{{- conditionaldate(true, tdate, ttime, tz) -}} |
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 @@ | ||
{%- macro error_messages(message, field, type) -%} | ||
<div><span class="error-type">{{ type }}</span><span class="error-field">{{ field }}</span><span class="error-message">{{ message }}</span></div> | ||
{%- endmacro -%} | ||
|
||
{{- error_messages('type': 'Invalid', 'message': 'The name is invalid', 'field': 'name') -}} |
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 @@ | ||
{%- macro hello(name) -%} | ||
{%- return "Hello " ~ name -%} | ||
{%- endmacro -%} | ||
|
||
{{- hello('World') -}} |
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 @@ | ||
{%- macro my_input(name, class="input-text") -%} | ||
{%- return text_field(name, 'class': class) -%} | ||
{%- endmacro -%} | ||
|
||
{{- '<p>' ~ my_input('name') ~ '</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{%- macro related_bar(related_links) -%} | ||
<ul> | ||
{%- for link in related_links -%} | ||
<li><a href="{{ url(link.url) }}" title="{{ link.title|striptags }}">{{ link.text }}</a></li> | ||
{%- endfor -%} | ||
</ul> | ||
{%- endmacro -%} | ||
|
||
{{- related_bar(links) -}} |
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 @@ | ||
{{- date.getTimeStamp() -}} % {{- strtotime('now') -}} % {{- strtotime(date.format('Y-m-d H:i:s')) -}} |