Overview

Packages

  • Pinoco
    • PAL

Classes

  • Pinoco_PAL_Attr
  • Pinoco_PAL_ContentNl2br
  • Pinoco_PAL_Namespace
  • Pinoco_PAL_NamespaceLoader
  • Pinoco_PAL_ReplaceNl2br
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Pinoco: makes existing static web site dynamic transparently.
 4:  * Copyright 2010-2011, Hisateru Tanaka <tanakahisateru@gmail.com>
 5:  *
 6:  * Licensed under The MIT License
 7:  * Redistributions of files must retain the above copyright notice.
 8:  *
 9:  * PHP Version 5
10:  *
11:  * @author     Hisateru Tanaka <tanakahisateru@gmail.com>
12:  * @copyright  Copyright 2010-2011, Hisateru Tanaka <tanakahisateru@gmail.com>
13:  * @license    MIT License (http://www.opensource.org/licenses/mit-license.php)
14:  * @package    Pinoco
15:  * @subpackage PAL
16:  */
17: 
18: if (!class_exists('PHPTAL')) { require_once 'PHPTAL.php'; }
19: if (!class_exists('PHPTAL_Namespace')) { require_once 'PHPTAL/Namespace.php'; }
20: if (!class_exists('PHPTAL_Php_Attribute_TAL_Replace')) { require_once 'PHPTAL/Php/Attribute/TAL/Replace.php'; }
21: 
22: /**
23:  * @package Pinoco
24:  * @subpackage PAL
25:  */
26: class Pinoco_PAL_ReplaceNl2br extends PHPTAL_Php_Attribute_TAL_Replace
27: {
28:     protected function doEchoAttribute(PHPTAL_Php_CodeWriter $codewriter, $code)
29:     {
30:         if ($code !== "''") {
31:             if ($this->_echoType === self::ECHO_TEXT) {
32:                 $codewriter->flush();
33:                 $codewriter->pushCode('echo nl2br('.$codewriter->escapeCode($code).')');
34:             }
35:             else {
36:                 $codewriter->pushCode('echo nl2br('.$codewriter->stringifyCode($codewriter->interpolateHTML($code)).')');
37:             }
38:         }
39:     }
40: }
41: 
42: 
43: 
Pinoco 0.8.0 Documentation API documentation generated by ApiGen 2.8.0