我可以在一个项目中同时使用 CakePHP 和 Prado 吗?

发布于 2024-08-09 01:18:28 字数 62 浏览 3 评论 0原文

我猜想这对于某些人来说可能听起来很明显,但我想知道没有复杂文件夹结构的框架是否可以在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

二智少女 2024-08-16 01:18:29

我猜是这样的 - 您可能只需要将 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.

孤独陪着我 2024-08-16 01:18:29

简单的答案是否定的。但是如果需要的话您可以这样做,但这两个框架有两种截然不同的方法。我不确定他们可以在哪里见面。 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.

夏末的微笑 2024-08-16 01:18:29

您应该选择一个框架作为主要框架,然后您可以使用另一个框架的部分内容。

例如,您将使用 Prado 及其所有结构,然后您将需要 CakePHP 框架的一些最喜欢的部分,就像

// cli install
composer require cakephp/orm // you can require full cakephp/cakephp if you need
// in controller (prado, cakephp, lavarel, symfony)
use Cake\ORM\TableRegistry;
....
public functoin view() // 
{
    $PostsTable = TableRegistry::get('Posts');
    $PostsTable->find('customFinder'); // take advantage of great CakePHP ORM
}

我有时这样做一样,使用 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

// cli install
composer require cakephp/orm // you can require full cakephp/cakephp if you need
// in controller (prado, cakephp, lavarel, symfony)
use Cake\ORM\TableRegistry;
....
public functoin view() // 
{
    $PostsTable = TableRegistry::get('Posts');
    $PostsTable->find('customFinder'); // take advantage of great CakePHP ORM
}

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..

≈。彩虹 2024-08-16 01:18:28

不知道为什么你想将两个具有单独规则的框架混合在一起,你应该查找 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文