Created
April 18, 2012 18:48
-
-
Save harikt/2415734 to your computer and use it in GitHub Desktop.
Sample with Aura View Escaper Branch
This file contains hidden or 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
| <?php | |
| $package_dir = dirname( __DIR__ ) . '/aurasystem/package'; | |
| $template = require_once $package_dir . '/Aura.View/scripts/instance.php'; | |
| // require_once $package_dir . '/Aura.Cli/src.php'; | |
| $template->var = 'Hello World'; | |
| $escaper = new stdclass(); | |
| $escaper->c = 'x'; | |
| $escaper->c .= ' > '; | |
| $escaper->c .= ' 2 '; | |
| $escaper1['b'] = 'x'; | |
| $escaper1['b'] .= ' > '; | |
| $escaper1['b'] .= ' 2 '; | |
| $template->addData([ | |
| 'hello' => 'this & that', | |
| 'world' => 'Hurray world', | |
| 'h1' => ' x > 2 ', | |
| 'h2' => ' y < 3 ', | |
| 'h3' => $escaper->c, | |
| 'h4' => $escaper1['b'] | |
| ]); | |
| echo $template->fetch('hello.php'); | |
| // Template file hello.php | |
| Hello Sample | |
| <?php echo $this->var . PHP_EOL; ?> | |
| <?php echo $this->hello . PHP_EOL; ?> | |
| <?php echo $this->world . PHP_EOL; ?> | |
| <?php | |
| $escaper['b'] = 'x'; | |
| $escaper['b'] .= ' > '; | |
| $escaper['b'] .= '2'; | |
| echo $escaper['b'] . PHP_EOL; | |
| $escaper1 = new Stdclass(); | |
| $escaper1->c = 'x'; | |
| $escaper1->c .= '>'; | |
| $escaper1->c .= '2'; | |
| echo $escaper1->c . PHP_EOL; | |
| echo 'h1 ' . $this->h1 . PHP_EOL; | |
| echo 'h2 ' . $this->h2 . PHP_EOL; | |
| echo 'h3 ' . $this->h3 . PHP_EOL; | |
| echo 'h4 ' . $this->h4 . PHP_EOL; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output :