雪帽/yamlfixtures-bundle

Symfony SnowcapYamlFixturesBundle

dev-master 2012-10-15 15:14 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:20:07 UTC


README

此包用于使用Symfony 2加载Yaml格式的数据

安装

  1. 将此包添加到您的 vendor/ 目录

    • 使用 vendors 脚本。

      在您的 deps 文件中添加以下行:

      [SnowcapYamlFixturesBundle]
          git=git://github.com/snowcap/SnowcapYamlFixturesBundle.git
          target=/bundles/Snowcap/YamlFixturesBundle
      

      运行 vendors 脚本

      ./bin/vendors install
      
    • 使用 git 子模块。

      $ git submodule add git://github.com/Snowcap/SnowcapYamlFixturesBundle.git vendor/bundles/Snowcap/YamlFixturesBundle
      
  2. 将 Snowcap 命名空间添加到您的自动加载器

     // app/autoload.php
     $loader->registerNamespaces(array(
           'Snowcap' => __DIR__.'/../vendor/bundles',
           // your other namespaces
     ));
    
  3. 将此包添加到应用程序的内核

     // app/ApplicationKernel.php
     public function registerBundles()
     {
         return array(
             // ...
             new Snowcap\YamlFixturesBundle\SnowcapYamlFixturesBundle(),
             // ...
         );
     }