ZF学习之新建控制器

image

目录结构如图所示

channel.php内容与index.php相仿~

ChannleController.php:

class ChannelController extends Zend_Controller_Action
  {
      public $registry;
      public $view;

      function init()
      {
      }

      function indexAction()
      {
          $this->view->title = 'index/index';
      }

      function lifeAction()
      {
          $this->view->title = 'index/life';
      }

      function doAction()
      {
          $this->view->title = 'index/do';
      }

      function addAction()
      {
          $this->view->title = 'index/add';
      }
  }

|-channel

|—index.pthml

|—life.phtml

|—do.phtml

life.phtml

<title>
<?php
echo $this->title;
?>
</title>

测试:http://zf.zaric.com/channel/life

image 
posted @ 2011-02-18 13:55  zaric  阅读(216)  评论(0编辑  收藏  举报