Home > Backend Development > PHP Tutorial > 关于zend framework的几个小问题

关于zend framework的几个小问题

WBOY
Release: 2016-06-13 13:01:03
Original
768 people have browsed it

关于zend framework的几个问题.
一.我的程序目录结构是
library
modules
  --company
      --controllers
          --ViewController.php
index.php

现在的访问地址是 127.0.0.1/user/index/view/id/88

怎么变成 127.0.0.1/user/view/id/88这种形式呢.不要index

第二个问题.

我想把 127.0.0.1/user/index/view/id/88这个URL变成 127.0.0.1/user/88
这种简洁形式.应该怎么定义路由呢.用下面的方法一直不行.

$route->addRoute('user',   
    new Zend_Controller_Router_Route('/user/:id',   
        array(  
            'controller'=>'index',  
            'action'=>'view'                        
        )  
    )  
) ;


用了一直报错说

Uncaught exception 'Zend_Controller_Action_Exception' with message 'Action "view" does not exist and was not trapped in __call()' in

请大家帮忙看看!不甚感激!
------解决方案--------------------
我虽然不懂php  这个肯定很好解决 自己去找路径在哪里默认的就好了
------解决方案--------------------
没用过ZF,但是CI的路由是正则匹配的。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template