我正在使用Symfony2/Doctrine创建项目并尝试实现特征.到目前为止,小试用没有问题,但我通常在复杂项目之前进行UML类和序列图.
什么是用于符号化PHP特征的UML设计对象,就我所知的行为而言可以看作是什么?有没有干净的方法呢?
非常感谢你的回答 !
萨科
在 Ubuntu 14.04 下,我正在编写一个输出大量文本(多个命令...)的脚本,并且我希望始终在终端屏幕顶部保留一行或多行以显示正在运行的标题。换句话说,我尝试减少终端垂直滚动区域并在该非滚动区域中写入。
我怎样才能做到这一点?我看到类似的东西使用循环逐行捕获输出,但我无法找到一种方法来告诉系统从第 2 行或第 3 行开始打印。
感谢您的回答,
尼古拉斯
我正在开发一个应用程序,其中有一些处理程序作为我希望能够调用的服务。他们都实现了一个ItemHandlerInterface.
我希望能够在控制器中检索所有ItemHandlerInterface服务集合,而无需手动连接它们。
到目前为止,我具体标记了它们:
服务.yaml
_instanceof:
App\Model\ItemHandlerInterface:
tags: [!php/const App\DependencyInjection\ItemHandlersCompilerPass::ITEM_HANDLER_TAG]
lazy: true
Run Code Online (Sandbox Code Playgroud)
并尝试在控制器中检索我的服务集合。如果只有一个服务实现,它就可以工作ItemHandlerInterface,但是一旦我创建了多个服务(如下面的TestHandler和 )Test2Handler,我最终会得到一个The service "service_locator.03wqafw.App\Controller\ItemUpdateController" has a dependency on a non-existent service "App\Model\ItemHandlerInterface".
如何动态检索实现我的接口的所有服务?
一种肮脏的解决方案是强制所有ItemHandlerInterface内容public: true并传递Container给我的控制器构造函数。但这很丑陋,我想找到一种更优雅的方式。
项目更新控制器
namespace App\Controller;
use App\Model\ItemHandlerInterface;
use App\Service\ItemFinder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Debug\Exception\ClassNotFoundException;
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use App\Model\Item;
use Psr\Container\ContainerInterface;
/**
* Class ItemUpdateController
*
* @package App\Controller
*/
class ItemUpdateController extends AbstractController
{
/**
* …Run Code Online (Sandbox Code Playgroud) 我想对EA管理实体中的字段使用自定义类型的地雷。
我正在使用SF Flex,因此我的类型已自动连接并正确设置为服务(显示为debug:container)。
现在,我希望在下面执行以下操作easy_admin.yaml:
Menu:
class: Lch\MenuBundle\Entity\Menu
help: 'admin.site.menu.help'
controller: App\Controller\Admin\Site\MenuController
list:
fields:
- title
- location
form:
fields:
- title
- location
- { property: menuItems, type: 'lch_menu_tree' }
Run Code Online (Sandbox Code Playgroud)
我在文档中发现,除了本机Type或EA之外,您什么都不能放在这里。
如何设置EA以使其在此特定字段中使用我的类型?