Coder Social home page Coder Social logo

slime-utilities's Introduction

SLIME Utilities

Abstraction functions to promote a fast and easy development workflow with Slim.

Most of these functions aren't specific to Slim and can be used in other contexts or on their own (except for the 'render' functions). We've bundled them together for convenience to be included with the Slime boilerplate and metaframework.

These functions are also available as separate packages:

Installation

composer require jyoungblood/slime-utilities
use Slime\render;
use Slime\db;
use Slime\http;
use Slime\cookie;
use Slime\x;

require __DIR__ . '/vendor/autoload.php';

API

Refer to the source packages for usage examples.

  • render::hbs($request, $response, $parameters)
  • render::redirect($request, $response, $parameters)
  • render::json($request, $response, $parameters)
  • render::lightncandy_html($parameters)($data)
  • render::initialize_handlebars_helpers()
  • render::twig($request, $response, $parameters)
  • db::init($settings)
  • db::insert($table, $input)
  • db::find($table, $criteria, $options)
  • db::update($table, $input, $criteria)
  • db::delete($table, $criteria)
  • db::create_placeholders($criteria)
  • http::request($url, $parameters)
  • http::get($url, $parameters)
  • http::post($url, $parameters)
  • http::json($url, $parameters)
  • cookie::set($key, $value, $parameters)
  • cookie::get($key)
  • cookie::delete($key)
  • x::email_send($parameters)
  • x::client_ip()
  • x::url_slug($string)
  • x::url_strip($url)
  • x::url_validate($url)
  • x::br2nl($string)
  • x::array_encode($array)
  • x::array_decode($string)
  • x::console_log($input, $parameters)
  • x::dd($input, $parameters)
  • x::file_write($input, $target_filename, $parameters)
  • x::error_log($input, $parameters)

slime-utilities's People

Contributors

jyoungblood avatar

Watchers

 avatar

slime-utilities's Issues

Is it possible to auto-build / compile when there’s a change in one of the packages?

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.