开发者

cakePHP : x_with in action / function causes errors... repeatable?

开发者 https://www.devze.com 2023-02-03 18:04 出处:网络
In a controller, make a dummy action, name it like stackoverflow_with开发者_运维问答_something()//the WITH part is important

In a controller, make a dummy action, name it like stackoverflow_with开发者_运维问答_something()//the WITH part is important

Create the view stackoverflow_with_something

Load up the page in a browser. Get a 'missing view error'

Take out the _with, try again. No error.

I havent seen any documentation on this, whats the deal?

short version : Why does xxxxx_with_xxxxx crash cakePHP, but xxxxx_xxxxx dosent?


No problems here, tried with the following:

/app/controllers/foos_controller.php:

<?php
class FoosController extends AppController {
    var $uses = null;

    function bar_with_yadda() {
    }
}
?>

/app/views/foos/bar_with_yadda.ctp:

Hello

requesting /foos/bar_with_yadda returns no error.

0

精彩评论

暂无评论...
验证码 换一张
取 消