Ouzo\Routing\Route::post PHP Method

post() public static method

public static post ( $uri, $action, array $options = [] )
$options array
    public static function post($uri, $action, array $options = array())
    {
        self::addRoute('POST', $uri, $action, true, $options);
    }

Usage Example

    /**
     * @test
     */
    public function shouldGenerateUriHelperForPost()
    {
        //given
        Route::post('/users/save', 'users#save');
        //when
        $generated = UriHelperGenerator::generate()->getGeneratedFunctions();
        //then
        $expected = <<<FUNCT
<?php
function checkParameter(\$parameter)
{
    if (!isset(\$parameter)) {
        throw new \\InvalidArgumentException("Missing parameters");
    }
}

function saveUsersPath()
{
    return url("/users/save");
}

function allGeneratedUriNames()
{
    return array('saveUsersPath');
}
FUNCT;
        $this->assertEquals($expected, $generated);
    }
All Usage Examples Of Ouzo\Routing\Route::post