Changeset 648


Ignore:
Timestamp:
02/01/09 17:03:02 (19 months ago)
Author:
wozozo
Message:
 
Location:
library/zf/zf-init
URL:
http://svn.nequal.jp/library/zf/zf-init
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • library/zf/zf-init/application/Initializer.php

    r646 r648  
    151151        $this->initControllers(); 
    152152        $this->initView(); 
    153         // $this->initDb(); 
     153        $this->initDb(); 
    154154        $this->initSession(); 
    155155        $this->initHelpers(); 
  • library/zf/zf-init/application/modules/default/controllers/IndexController.php

    r619 r648  
    1010class IndexController extends App_Controller_Action_Abstract 
    1111{ 
    12     /** 
    13     * The default action - show the home page 
    14     */ 
     12    /** 
     13    * The default action - show the home page 
     14    */ 
    1515    public function indexAction()  
    1616    { 
    17         $rows = array('first', 'second', 'third'); 
    18         $this->view->assign('rows', $rows); 
    19         $this->view->myVar = 'IndexController'; 
    2017    } 
    2118} 
  • library/zf/zf-init/application/modules/default/models/Users.php

    r167 r648  
    66 * @version  
    77 */ 
    8 require_once 'Zend/Db/Table/Abstract.php'; 
    9 class Users extends Zend_Db_Table_Abstract 
     8// require_once 'Zend/Db/Table/Abstract.php'; 
     9class Users extends App_Db_Table_Abstract 
    1010{ 
    1111    /** 
     
    1313     */ 
    1414    protected $_name = 'users'; 
     15     
     16    public function hoge() {} 
    1517} 
  • library/zf/zf-init/application/modules/default/views/scripts/error/error.phtml

    r169 r648  
    1 {% extends "main.phtml" %} 
    2  
    3 {% block title %} Error Page {% endblock %} 
    4  
    5 {% block content %} 
    6     <h1>{{ title }}</h1> 
    7     {% if message %} 
    8         <p>The following error occurred:</p> 
    9         <pre>{{ message }}</pre> 
    10     {% else%}  
    11         <p>hoge</p> 
    12     {% endif %} 
    13 {% endblock %} 
    14  
     1<?php if ($this->message): ?> 
     2    <p>The following error occurred:</p> 
     3    <?php echo "<pre>".$this->message."</pre>" ?> 
     4    <?php Zend_Debug::dump($this);?> 
     5    <?php echo $this ?> 
     6<?php endif; ?> 
  • library/zf/zf-init/application/modules/default/views/scripts/index/index.phtml

    r172 r648  
    1 {% extends "main.phtml" %} 
    2  
    3 {% block title %}My Calypso DTL example - Foo/index{% endblock %} 
    4  
    5 {% block content %} 
    6  
    7 {{ myVar }} 
    8  
    9 {% for row in rows %} 
    10     <p>{{ row }}</p> 
    11 {% endfor %} 
    12  
    13 {% endblock %} 
     1index 
  • library/zf/zf-init/application/modules/default/views/scripts/main.phtml

    r169 r648  
    33        <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    44        <meta http-equiv="Content-Style-Type" content="text/css" /> 
    5         <title>{% block title %}My Calypso DTL example{% endblock %}</title> 
     5        <title></title> 
    66    </head> 
    77 
    88    <body> 
    9         {% block content %}{% endblock %} 
     9         
     10        <?php echo $this->layout()->content ?> 
     11         
    1012    </body> 
    1113</html> 
  • library/zf/zf-init/library/App/Controller/Action/Abstract.php

    r646 r648  
    9898 
    9999        // Initialize 
    100         $this->_initView()->_initLayout()->_loadModelPath(); 
     100        // $this->_initView()->_initLayout()->_loadModelPath(); 
    101101    } 
    102102     
  • library/zf/zf-init/library/App/Db/Table/Abstract.php

    r647 r648  
    66{ 
    77    /** 
     8     * factory 
     9     * 
     10     * @param string $tableName 
     11     * @return App_Db_Table_Abstract 
     12     */ 
     13    public static function factory($tableName) 
     14    { 
     15        $className = ucfirst($tableName); 
     16        return new $className(); 
     17    } 
     18     
     19    /** 
    820     * find() and where 
    921     * 
    1022     * @param int $id 
    1123     * @param array $where 
    12      * @return Zend_Db_Table_Row_Abstract|null 
     24     * @param boolean $echo 
     25     * @return array|null 
    1326     */ 
    14     public function findBy($id, $where = null) 
     27    public function findBy($id, $where = null, $echo = false) 
    1528    { 
    1629        $select = $this->select() 
     
    2336        } 
    2437         
     38        if ($echo) return $this->_echo($select); 
     39         
     40        return $this->_fetchRow($select); 
     41    } 
     42    /** 
     43     * _fetchRow 
     44     * 
     45     * @param Zend_Db_Table_Select $select 
     46     * @return array 
     47     */ 
     48    protected function _fetchRow($select) 
     49    { 
    2550        $res = $this->fetchRow($select); 
    2651        if ($res == null) return null; 
    2752         
    28         return $res; 
     53        return $res->toArray(); 
     54    } 
     55     
     56    /** 
     57     * debug SQL 
     58     * 
     59     * @param Zend_Db_Table_Select $select 
     60     * @return string 
     61     */ 
     62    protected function _echo($select) 
     63    { 
     64        return $select->__toString(); 
    2965    } 
    3066} 
Note: See TracChangeset for help on using the changeset viewer.