Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

formio/formio-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is now considered legacy and no longer supported. Please take a look at our recent repositories and help documentation at the following links.

PHP Integration with Form.io

This serves as an initial PHP integration within Form.io. The intent is to make this library not have any dependencies other than PHP to integrate within the Form.io API platform.

Examples

Single sign on (SSO) into Form.io from PHP

<?php
  require_once('Formio.php');
  $formio = new Formio('https://myproject.form.io', array(
    'default_password' => '123testing'
  ));

  // This token can now be used to authenticate into Form.io API Platform
  print_r $formio->ssoToken('test@example.com');
?>

Login as an employee and create a resource.

<?php
  require_once('Formio.php');
  $formio = new Formio('https://myproject.form.io', array(
    'resource' => 'employee'
  ));
  $employee = $formio->login('employee@example.com', '123testing');

  // The employee object.
  print_r($employee);

  // The users token...
  print $formio->token;

  // This will now post using the Employee's auth token.
  $resource = $formio->post('resource', array('data' => array(
    'employee' => $employee['_id'],
    'status' => 'opened',
    'title' => 'TPS Report'
  )));

  print_r($resource['body']);
?>

About

PHP Integration with Form.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages