fousheezy/common

ZF2 常用元素

dev-master 2015-01-15 16:19 UTC

This package is not auto-updated.

Last update: 2024-09-23 23:52:11 UTC


README

服务

  • FzyCommon\Service\EntityToForm: 接受 doctrine 实体并返回一个与实体绑定并使用其实体信息填充的 ZF2 表单类 (\Zend\Form\Form)。
  • FzyCommon\EntityToForm: FzyCommon\Service\EntityToForm 的别名
  • FzyCommon\Service\Search\Result: 接受一个结果提供者接口并以标准方式格式化搜索结果
  • FzyCommon\Search\Result: FzyCommon\Service\Search\Result 的别名
  • FzyCommon\Service\Url: 从 ZF2 路由名称或 AWS S3 键创建 URL 的服务
  • FzyCommon\Url: FzyCommon\Service\Url 的别名
  • FzyCommon\Service\Render: 将视图模型或字符串路径渲染为 HTML 的服务
  • FzyCommon\Render: FzyCommon\Service\Render 的别名
  • FzyCommon\Config: 返回包装在 \FzyCommon\Util\Params 容器中的 ZF2 应用程序的配置。
  • FzyCommon\ModuleConfig: 返回特定于此模块的配置数据(\FzyCommon\Service\Base::MODULE_CONFIG_KEY),并包装在 \FzyCommon\Util\Params 容器中。
  • FzyCommon\Service\Aws\Config: 返回从 FzyCommon\ModuleConfig 中获取的 aws 键,并包装在 \FzyCommon\Util\Params 容器中。
  • FzyCommon\Service\Aws\S3\Config: 返回从 FzyCommon\Service\Aws\Config 中获取的 s3 键,并包装在 \FzyCommon\Util\Params 容器中。
  • FzyCommon\Service\Aws\S3: 返回配置的 \Aws\S3\S3Client 对象(使用 FzyCommon\Service\Aws\S3\Config
  • FzyCommon\Factory\DoctrineCache: 根据环境返回配置的 Doctrine\Common\Cache

视图辅助函数

  • fzyFlashMessages: 返回一个按类型索引的消息数组的数组,例如 [ "success": [ "您的设置已保存" ], "warning": [], "danger": [], "info": [] ]
  • fzyEntityToForm: 提供对 FzyCommon\Service\EntityToForm 服务的快捷访问
  • fzyNgInit: 处理用于注入到 angular 范围中的 json 编码和转义字面量、对象和 doctrine 实体
  • fzyRequest: 视图访问器,用于查询当前请求

控制器插件

  • fzySearchResult: 用于标准化搜索响应格式的插件
  • fzyUpdateResult: 用于标准化更新响应格式的插件
  • fzyEntityToForm: 提供对 FzyCommon\Service\EntityToForm 服务的快捷访问

控制器

选项

  • debug: 作为标志,表示此代码应公开错误和异常以进行调试。
  • production: 作为标志,表示此代码正在生产环境中运行。
  • doctrine_cache: 用于生成 doctrine 缓存对象的服务键。默认为 FzyCommon\Factory\DoctrineCache,这是一个 Redis 服务
  • doctrine_cache_config: 设置 doctrine_cache 服务的配置。默认为 Redis 连接凭据
  • aws: 连接到 AWS 服务的配置(应包含按服务索引的凭据,例如
"aws": [
  "s3": [
    "key": "your-aws-key",
    "secret": "your-aws-secret"
  ]
]