Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
885 additions
and 140 deletions.
- +1 −1 components.js
- +1 −0 components.json
- +85 −41 components/prism-smarty.js
- +1 −1 components/prism-smarty.min.js
- +121 −0 tests/languages/smarty!+php/inclusion.test
- +11 −17 tests/languages/smarty/attr-name_feature.test
- +51 −0 tests/languages/smarty/booelan_feature.test
- +19 −3 tests/languages/smarty/comment_feature.test
- +4 −4 tests/languages/smarty/function_feature.test
- +35 −51 tests/languages/smarty/keyword_feature.test
- +16 −18 tests/languages/smarty/operator_feature.test
- +81 −0 tests/languages/smarty/php_feature.test
- +33 −0 tests/languages/smarty/punctuation_feature.test
- +345 −3 tests/languages/smarty/string_feature.test
- +81 −1 tests/languages/smarty/variable_feature.test
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
@@ -1219,6 +1219,7 @@ | ||
"smarty": { | ||
"title": "Smarty", | ||
"require": "markup-templating", | ||
"optional": "php", | ||
"owner": "Golmote" | ||
}, | ||
"sml": { | ||
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
@@ -0,0 +1,121 @@ | ||
{php} | ||
// including a php script directly from the template. | ||
include('/path/to/display_weather.php'); | ||
{/php} | ||
|
||
{* this template includes a {php} block that assign's the variable $varX *} | ||
{php} | ||
global $foo, $bar; | ||
if($foo == $bar){ | ||
echo 'This will be sent to browser'; | ||
} | ||
// assign a variable to Smarty | ||
$this->assign('varX','Toffee'); | ||
{/php} | ||
{* output the variable *} | ||
<strong>{$varX}</strong> is my fav ice cream :-) | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["smarty", [ | ||
["embedded-php", [ | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "php"], | ||
["delimiter", "}"] | ||
]], | ||
["php", [ | ||
["comment", "// including a php script directly from the template."], | ||
|
||
["keyword", "include"], | ||
["punctuation", "("], | ||
["string", "'/path/to/display_weather.php'"], | ||
["punctuation", ")"], | ||
["punctuation", ";"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{/"], | ||
["keyword", "php"], | ||
["delimiter", "}"] | ||
]] | ||
]] | ||
]], | ||
|
||
["smarty", [ | ||
["comment", "{* this template includes a {php} block that assign's the variable $varX *}"] | ||
]], | ||
|
||
["smarty", [ | ||
["embedded-php", [ | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "php"], | ||
["delimiter", "}"] | ||
]], | ||
["php", [ | ||
["keyword", "global"], | ||
["variable", "$foo"], | ||
["punctuation", ","], | ||
["variable", "$bar"], | ||
["punctuation", ";"], | ||
|
||
["keyword", "if"], | ||
["punctuation", "("], | ||
["variable", "$foo"], | ||
["operator", "=="], | ||
["variable", "$bar"], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
|
||
["keyword", "echo"], | ||
["string", "'This will be sent to browser'"], | ||
["punctuation", ";"], | ||
|
||
["punctuation", "}"], | ||
|
||
["comment", "// assign a variable to Smarty"], | ||
|
||
["variable", "$this"], | ||
["operator", "->"], | ||
["function", ["assign"]], | ||
["punctuation", "("], | ||
["string", "'varX'"], | ||
["punctuation", ","], | ||
["string", "'Toffee'"], | ||
["punctuation", ")"], | ||
["punctuation", ";"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{/"], | ||
["keyword", "php"], | ||
["delimiter", "}"] | ||
]] | ||
]] | ||
]], | ||
|
||
["smarty", [ | ||
["comment", "{* output the variable *}"] | ||
]], | ||
|
||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"strong" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["variable", "$varX"], | ||
["delimiter", "}"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"strong" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
" is my fav ice cream :-)" | ||
] |
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
@@ -0,0 +1,51 @@ | ||
{if false} | ||
{if off} | ||
{if on} | ||
{if no} | ||
{if true} | ||
{if yes} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "false"], | ||
["delimiter", "}"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "off"], | ||
["delimiter", "}"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "on"], | ||
["delimiter", "}"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "no"], | ||
["delimiter", "}"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "true"], | ||
["delimiter", "}"] | ||
]], | ||
["smarty", [ | ||
["delimiter", "{"], | ||
["keyword", "if"], | ||
["boolean", "yes"], | ||
["delimiter", "}"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keywords. |
Oops, something went wrong.