我可以在一个项目中同时使用 CakePHP 和 Prado 吗?
我猜想这对于某些人来说可能听起来很明显,但我想知道没有复杂文件夹结构的框架是否可以在 CakePHP 中使用。
I can guess that this might sound obvious for some people out there, but I would like to know whether a Framework which has no complex folder-structure can be used within CakePHP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我猜是这样的 - 您可能只需要将 Prado 的东西(顺便说一下,我完全不熟悉)放在您的 Cake 站点的
/app/webroot
目录中。I'm guessing so - you probably just need to put the Prado stuff (which I'm completely unfamiliar with, by the way) in the
/app/webroot
directory of your Cake site.简单的答案是否定的。但是如果需要的话您可以这样做,但这两个框架有两种截然不同的方法。我不确定他们可以在哪里见面。 CakePHP 组合更有可能在 Prado 中使用,但反之则不然,因为 Prado 的所有层都严重依赖于彼此。例如 prodo 组件很可能需要 prado 表单。
我不知道为什么你会一起使用它们,但如果不使用 prado,我会建议使用 YII。它是由同一个人制造的,因为他们知道普拉多的局限性。但概念上很相似,并且可以与其他框架更好地配合。
The simple answer is No. But you could if you needed to but these two frameworks have two very different approaches. I am not sure where they could meet. CakePHP couple more likely be used within Prado but not the other way around because all layers of Prado are so heavily dependent on each other. Such as a prodo component will most likely need a prado form.
I am not sure why you would use them together but if are not using prado yet I would sudgest using YII. It is made by the same guys because they knew the limitations in prado. But conceptially simular and could play better with other frameworks.
您应该选择一个框架作为主要框架,然后您可以使用另一个框架的部分内容。
例如,您将使用 Prado 及其所有结构,然后您将需要 CakePHP 框架的一些最喜欢的部分,就像
我有时这样做一样,使用 CakePHP 作为主要部分,然后使用 Symfony/Lavarel 部分作为供应商。
你甚至可以看到基本的安装框架 Cakephp/app 加载了一些 symfony 部件和其他供应商。
You should pick one framework as main and then you can use parts of another framework.
E.g. you'll use Prado with all its structure and then you'll require some favorite parts of CakePHP framweork like
I do this sometimes, using CakePHP as main and then using Symfony/Lavarel parts as vendor.
You can see even basic installation skeleton
cakephp/app
loads some symfony parts and other vendors..不知道为什么你想将两个具有单独规则的框架混合在一起,你应该查找 CakePHP 供应商:http://book.cakephp.org/view/538/Loading-Vendor-Files
这允许您加载任何您想要的框架/库/类等,因为 Cake 不假设任何事情关于您的供应商,允许您按照您需要的方式加载它们(例如......自定义组件)
Not sure why you'd want to mix two frameworks with separate rules together, you should look up CakePHP Vendors: http://book.cakephp.org/view/538/Loading-Vendor-Files
This allows you to load any framework / library / class etc you wish because Cake doesn't assume a thing about your vendors, allowing you to load them in how you need (with say... a custom component for example)