Changeset 648
- Timestamp:
- 02/01/09 17:03:02 (19 months ago)
- Location:
- library/zf/zf-init
- URL:
- http://svn.nequal.jp/library/zf/zf-init
- Files:
-
- 8 edited
-
application/Initializer.php (modified) (1 diff)
-
application/modules/default/controllers/IndexController.php (modified) (1 diff)
-
application/modules/default/models/Users.php (modified) (2 diffs)
-
application/modules/default/views/scripts/error/error.phtml (modified) (1 diff)
-
application/modules/default/views/scripts/index/index.phtml (modified) (1 diff)
-
application/modules/default/views/scripts/main.phtml (modified) (1 diff)
-
library/App/Controller/Action/Abstract.php (modified) (1 diff)
-
library/App/Db/Table/Abstract.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
library/zf/zf-init/application/Initializer.php
r646 r648 151 151 $this->initControllers(); 152 152 $this->initView(); 153 //$this->initDb();153 $this->initDb(); 154 154 $this->initSession(); 155 155 $this->initHelpers(); -
library/zf/zf-init/application/modules/default/controllers/IndexController.php
r619 r648 10 10 class IndexController extends App_Controller_Action_Abstract 11 11 { 12 /**13 * The default action - show the home page14 */12 /** 13 * The default action - show the home page 14 */ 15 15 public function indexAction() 16 16 { 17 $rows = array('first', 'second', 'third');18 $this->view->assign('rows', $rows);19 $this->view->myVar = 'IndexController';20 17 } 21 18 } -
library/zf/zf-init/application/modules/default/models/Users.php
r167 r648 6 6 * @version 7 7 */ 8 require_once 'Zend/Db/Table/Abstract.php';9 class Users extends Zend_Db_Table_Abstract8 // require_once 'Zend/Db/Table/Abstract.php'; 9 class Users extends App_Db_Table_Abstract 10 10 { 11 11 /** … … 13 13 */ 14 14 protected $_name = 'users'; 15 16 public function hoge() {} 15 17 } -
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 %} 1 index -
library/zf/zf-init/application/modules/default/views/scripts/main.phtml
r169 r648 3 3 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 4 4 <meta http-equiv="Content-Style-Type" content="text/css" /> 5 <title> {% block title %}My Calypso DTL example{% endblock %}</title>5 <title></title> 6 6 </head> 7 7 8 8 <body> 9 {% block content %}{% endblock %} 9 10 <?php echo $this->layout()->content ?> 11 10 12 </body> 11 13 </html> -
library/zf/zf-init/library/App/Controller/Action/Abstract.php
r646 r648 98 98 99 99 // Initialize 100 $this->_initView()->_initLayout()->_loadModelPath();100 // $this->_initView()->_initLayout()->_loadModelPath(); 101 101 } 102 102 -
library/zf/zf-init/library/App/Db/Table/Abstract.php
r647 r648 6 6 { 7 7 /** 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 /** 8 20 * find() and where 9 21 * 10 22 * @param int $id 11 23 * @param array $where 12 * @return Zend_Db_Table_Row_Abstract|null 24 * @param boolean $echo 25 * @return array|null 13 26 */ 14 public function findBy($id, $where = null )27 public function findBy($id, $where = null, $echo = false) 15 28 { 16 29 $select = $this->select() … … 23 36 } 24 37 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 { 25 50 $res = $this->fetchRow($select); 26 51 if ($res == null) return null; 27 52 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(); 29 65 } 30 66 }
Note: See TracChangeset
for help on using the changeset viewer.
