pinsn 2012-05-07 15:10:48 2158次浏览 2条回复 0 0 0

测试控制器方法是不是一定要视图啊?

比如: abController.php有个方法

public function actionTest($pid)
{
    return "this";
}

我用 http://localhost/promange/ab/test.html 这样的不能访问。

  • 回复于 2012-05-07 15:24 举报

    你没有输出值,请把return改成echo!

  • 回复于 2012-05-07 17:13 举报
    public function actionTest()
    {
          $id = $_GET['id'];
          echo $id;
    }
    

    你修改成这样试试。。 貌似 actionTest($id); 然后 localhost/test/id/123 访问会失败。

您需要登录后才可以回复。登录 | 立即注册