开发者

CakePHP 1.1 "parseExtension" inexsistent

开发者 https://www.devze.com 2023-02-19 07:39 出处:网络
I have a problem with a site in CakePHP 1.1 which is impossible to migrate from version due to开发者_JAVA百科 the size of the project.

I have a problem with a site in CakePHP 1.1 which is impossible to migrate from version due to开发者_JAVA百科 the size of the project.

I need to create methods to which call using extensions, for example:

$Route->connect('/xxx.xml', array ('controller' => 'Interactive', 'action' => 'xxx'));

But this does not work and the problem is that Cake 1.1 does not have this function:

Router::parseExtensions('xml');

Has anyone working with cakephp 1.1 had this problem? If so do they know how to fix it?

Thanks.


I'm not 100% familiar of the capabilities of CakePHP 1.1, but have you considered setting up a router to look for something like the following:

/:controller/:action.xml

Then you could control what controller/action it leads to and alter the layout.

You might need to escape the . on .xml.

I would seriously consider upgrading to CakePHP 1.3 and reading the migration docs.


The problem is not the layout, is this:

if i set this router:

$Route->connect('/xxx.xml', array ('controller' => 'Interactive', 'action' => 'xxx'));

or your example:

$Route->connect('/:controller/:xxx.xml', array ('controller' => 'Interactive', 'action' => 'xxx'));

the function called is:

class MuControlController extends AppController {
   function xxx.xml() {
   }

obiusly this function cant exists.

0

精彩评论

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