沃梦达 / 编程问答 / php问题 / 正文

Cakephp 2.1 版本更改中的命名约定问题

Cakephp 2.1 naming convensions issue in version change(Cakephp 2.1 版本更改中的命名约定问题)

本文介绍了Cakephp 2.1 版本更改中的命名约定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 CakePHP 2.1.只是看到它的命名约定与旧版本相比发生了很大变化,这让我抓狂.

I have just installed CakePHP 2.1. And just see that the naming convention of its is just change lot from the older version which making me crazy.

就像是 app/controllers 而现在是 app/Controller 一样

Like it was app/controllers while now it is app/Controller same way

app/models - app/Model

app/views - app/View

我知道这样做一定有一些优势.但我的问题是,当我使用蛋糕烘焙时,它会以同样的旧方式创建目录,即 controllers/models/views.从 URL & 无法再访问哪个显然会抛出错误.

I know there must be some advantage on doing this. But my problem is when I use the cake bake it is creating directory in the same old fashion i.e. controllers/models/views. Which is no more accessible from the URL & obviously will throw an error.

有人遇到同样的问题吗?有没有什么解决方案可以让蛋糕烘焙也使用相同的约定?

Is anyone there who has face the same issue ? Is there any solution that cake bake also use the same conventions ?

任何帮助将不胜感激.谢谢.

Any help will be appreciate. Thanks.

推荐答案

你总是可以使用显式路径:

you can always use explicit paths:

/path/to/app_dir>..libCakeConsolecake bake

来自当前蛋糕项目的 APP 目录.这是万无一失的,并且始终适用于正确的蛋糕版本.

from your APP dir of the current cake project. this is foolprove and always works with the right cake version.

我这样做并使用键盘上的快捷方式在一次击键时打印(最多蛋糕").

I do it this way and use a shortcut on my keyboard to print this (up to "cake") on a single key stroke.

这篇关于Cakephp 2.1 版本更改中的命名约定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Cakephp 2.1 版本更改中的命名约定问题

基础教程推荐