phlexible/element-finder-bundle

phlexible 元素查找包

安装: 153

依赖项: 0

建议者: 0

安全: 0

星星: 0

观察者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.3.4 2017-04-19 21:25 UTC

This package is auto-updated.

Last update: 2024-09-08 07:04:24 UTC


README

PhlexibleElementFinderBundle 在 phlexible 中添加了对查找字段的支持。

安装

  1. 使用 composer 下载 PhlexibleElementFinderBundle
  2. 启用 Bundle
  3. 导入 PhlexibleElementFinderBundle 路由
  4. 更新你的数据库模式
  5. 清除 symfony 缓存

步骤 1:使用 composer 下载 PhlexibleElementFinderBundle

运行以下命令添加 PhlexibleElementFinderBundle

$ php composer.phar require phlexible/element-finder-bundle "~1.0.0"

Composer 会将包安装到你的项目的 vendor/phlexible 目录中。

步骤 2:启用 bundle

在 kernel 中启用 bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Phlexible\Bundle\ElementFinderBundle\PhlexibleElementFinderBundle(),
    );
}

步骤 3:导入 PhlexibleElementFinderBundle 路由

导入 PhlexibleElementFinderBundle 路由。

对于前端

# app/config/routing.yml
phlexible_element_finder_render:
    resource: "@PhlexibleElementFinderBundle/Controller/RenderController.php"
    type:     annotation

对于管理后端

# app/config/admin_routing.yml
phlexible_element_finder_config:
    resource: "@PhlexibleElementFinderBundle/Controller/ConfigController.php"
    type:     annotation

步骤 4:更新你的数据库模式

现在 bundle 已经设置好了,你需要最后更新你的数据库模式,因为元素查找包括需要在你的数据库中安装的实体。

对于 ORM 运行以下命令。

$ php app/console doctrine:schema:update --force

步骤 5:清除 symfony 缓存

如果你以环境 prod 访问 phlexible 应用程序,请清除缓存

$ php app/console cache:clear --env=prod