欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ZF学习之新建控制器

程序员文章站 2022-06-30 19:14:36
...

ZF学习之新建控制器

目录结构如图所示

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

 

转载于:https://www.cnblogs.com/zaric/archive/2011/02/18/1957754.html