jarenal/tiny-tasks-bundle

Tiny Tasks Bundle 是一个用于 Symfony 3 及以上版本的演示任务管理应用程序。

安装: 16

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放性问题: 0

类型:symfony-bundle

1.0.0 2016-08-25 01:24 UTC

This package is not auto-updated.

Last update: 2024-09-26 04:00:54 UTC


README

我开发这个包是为了测试和演示目的。

用于构建此包的一些主要库包括

安装

步骤 1:下载 Bundle

打开命令行,进入您的项目目录,并执行以下命令以下载此 Bundle 的最新稳定版本

    $ composer require jarenal/tiny-tasks-bundle

此命令要求您已全局安装 Composer,如 Composer 文档中的安装章节中所述。

步骤 2:启用 Bundle 和依赖项

然后,通过将其添加到项目中 app/AppKernel.php 文件中注册的 Bundle 列表来启用此 Bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Jarenal\TinyTasksBundle\JarenalTinyTasksBundle(),
            new FOS\RestBundle\FOSRestBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle(),
        );


        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            // ...

            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
        }
    }

    // ...
}

步骤 3:启用路由

要启用路由,请将以下行添加到您的 app/config/routing.yml 文件中

    jarenal_tiny_tasks_bundle:
        resource: "@JarenalTinyTasksBundle/Resources/config/routing.yml"

步骤 4:FosRestBundle 设置

在您的 app/config/config.yml 文件中添加以下行,以设置 FosRestBundle 的默认配置

    fos_rest:
        routing_loader:
            default_format: json

步骤 5:数据库设置

NOTICE: Please note that this bundle is for testing purposes, so be careful before to execute the next commands in your database.

首先,如果尚未完成,请进入您的 app/config/parameters.yml 并输入数据库参数

然后创建数据库(如果不存在)

    $ php bin/console doctrine:database:create

更新模式以生成表

    $ php bin/console doctrine:schema:update

加载状态表的默认固定数据

    $ php bin/console doctrine:fixtures:load

步骤 6:发布资源

发布 Bundle 资源

    $ php bin/console assets:install --symlink

步骤 7:清除缓存并尝试使用它!

清除 Symfony 缓存

    $ php bin/console cache:clear

最后,使用以下 URL 调用 Bundle

http://YOUR_SERVER/tiny-tasks