ais/pertemuandosenbundle

一个包含 PertemuanDosen 的包

dev-master / 0.0.1.x-dev 2016-01-11 05:28 UTC

This package is not auto-updated.

Last update: 2024-09-24 19:45:47 UTC


README

pertemuandosen 包用于 AIS。我在我的环境中使用 Symfony 2.7.4。如果您想安装 Symfony,请遵循以下链接

Symfony 2.7

用法

我假设您已经在开发环境中安装了 composer。如果没有,请访问此链接

使用 Composer 入门

在您的根 composer.json 文件中的 require 标签内添加以下内容

{
    "require": {
      "ais/pertemuandosenbundle" : "dev-master"
    },
}

运行 composer update,并等待更新完成。

php composer.phar update

将包注册到您的 AppKernel.php 中

一旦 composer 更新完成。如果您之前还没有安装 NelmioApiDocBundle,您也需要注册它。

因为这个包需要 NelmioApiDocBundle 来查看 API 文档。我还使用了 JMS Serializer 和 FOSRestBundle。

<?php
// app/AppKernel.php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
        ...
            new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
            new FOS\RestBundle\FOSRestBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle(),
            new Ais\PertemuanDosenBundle\AisPertemuanDosenBundle(),
        );
        ...

        return $bundles;
    }
}

将路由导入您的 app/config/routing.yml

  ais_pertemuandosens:
    type: rest
    prefix: /api
    resource: "@AisPertemuanDosenBundle/Resources/config/routes.yml"
  
  NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

看看里面有什么

现在您可以通过访问您的 url dev 来查看可用的 API

ex: https:///web/app_dev.php/api/doc

发现错别字?请向我提出 PR。如果您发现一些错误,请通过电子邮件帮助我修复它,发送至 vizzlearn@gmail.com