Code Monkey home page Code Monkey logo

bearsunday.vim's Introduction

BEAR.Sunday vim plugin

Resource

BEARResource command calls api from editing buffer.

usage:

:BEARResource {method} [{params}]

example:

class EditingResource extends ResourceObject
{
    public function onGet(int $id, string $name) : ResourceObject
    {
        $this->body = [
            'message' => 'hello, ' . $name,
            'id' => $id
        ];

        return $this;
    }
}
:BEARResource get id=3 name=Foo

and buffer will open with response.

php bin/page.php get /editingResource?id=3&name=Foo


"200 OK",
"Content-Type: application/hal+json",
"ETag: 703429597",
"Last-Modified: Sun, 10 Nov 2019 06:47:53 GMT",

{
  "message": "hello, Foo",
  "id": 3
}

you can close buffer with type q.

Skeleton

if you open new file in src/Resource/App or src/Resource/Page , new file will open with skeleton code.

example:

# in your shell
$ vim src/Resource/App/SomeNewResource.php
<?php
namespace Vendor\Prefix\Resource\App;

use BEAR\Resource\ResourceObject;

class SomeNewResource extends ResourceObject
{
    public function onGet() : ResourceObject
    {
    }
}

Vendor\Prefix in namespace will be replaced by composer.json's autoload.psr-4 setting.

bearsunday.vim's People

Contributors

amashigeseiji avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.