cblanquera/cradle-csrf

This package is abandoned and no longer maintained. The author suggests using the cradlephp/cradle-csrf package instead.

CSRF handler for Cradle

Installs: 4 801

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:plugin

dev-master 2018-03-12 06:57 UTC

This package is auto-updated.

Last update: 2022-02-01 13:00:42 UTC


README

Deprecation Notice: This project has been moved to https://github.com/CradlePHP/cradle-csrf

cradle-csrf

CSRF Handling for Cradle

1. Requirements

You should be using CradlePHP currently at dev-master. See https://cradlephp.github.io/ for more information.

2. Install

composer require cblanquera/cradle-csrf

Then in /bootstrap.php, add

->register('cblanquera/cradle-csrf')

3. Recipes

Once the database is installed open up /public/index.php and add the following.

<?php

use Cradle\Framework\Flow;

return cradle()
    //add routes here
    ->get('/csrf/test', 'CSRF Page')
    ->post('/csrf/test', 'CSRF Process')

    //add flows here
    //renders a table display
    ->flow('CSRF Page',
        Flow::csrf()->load,
        Flow::csrf()->render,
        'TODO: form page'
    )
    ->flow('CSRF Process',
        Flow::csrf()->check,
        array(
            Flow::csrf()->yes,
            'TODO: process'
        ),
        array(
            Flow::csrf()->no,
            'TODO: deny'
        )
    );