Download the PHP package jyoungblood/slime-render without Composer

On this page you can find all versions of the php package jyoungblood/slime-render. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slime-render

SLIME Render

PHP abstraction functions to help more easily render views for Slim Framework (v4) with plain text, HTML, JSON, and Handlebars (using LightnCandy)

These functions aim to provide a simplified and standardized interface for rendering various types of data-driven responses as PSR-7 objects for use with Slim.

Included with the Slime boilerplate for Slim applications.

Installation

Easy install with composer:

Requirements

Usage

render::html($request, $response, $string, $status = 200)

Renders a string as HTML. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

Additionally, a path to an HTML file can be specified to load and render instead of a string:

render::text($request, $response, $string, $status = 200)

Renders a string as plain text. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

render::hbs($request, $response, $parameters, $status = 200)

Renders a specific Handlebars template with an array of data, including any partials and global locals variables array. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

The parser function expects templates to be in a templates directory with html file extension. This can be customized by defining these variables in a global settings array:

Additionally, an array of locals can be added to make variables available across all templates:

Parameters from PHP $_GET and $_POST variables are automatically made available to templates rendered with this function, using the variables {{GET}} and {{POST}}:

Check out the Handlebars Cookbook to see everything you can do with LightnCandy and Handlebars.

Additionally, we've included a couple of helper functions.

The date helper applies the PHP date() function to a given variable or string (or now keyword for the current time)

The #is block helper allows for basic conditional logic:

Custom helpers are easy to create. Take a look at how these helpers are defined in initialize_handlebars_helpers(). The Handlebars cookbook also has a reference for creating custom helpers and custom block helpers.

render::handlebars($parameters)

Renders a specicific Handlebars template with data array the same as render::hbs(), but returns raw html instead of a PSR-7 response.

render::redirect($request, $response, $string, $status = 302)

Renders a redirect as standard Slim (PSR-7) response object with optional HTTP status code.

render::json($request, $response, $data, $status = 200)

Renders an array or data as standard Slim (PSR-7) response object with application/json content type and optional HTTP status code.

render::lightncandy_html($parameters)($data)

Prepares and compiles a specific Handlebars template with an array of data, including any partials and global locals variables array.
This is automatically called by render::hbs() but can be used as a standalone function if desired.

render::initialize_handlebars_helpers()

For internal use by lightncandy_html(). Defines a couple custom Handlebars helper functions to be used by the LightnCandy compiler.


All versions of slime-render with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jyoungblood/slime-render contains the following files

Loading the files please wait ....