2017 © Pedro Peláez
 

library legacy

image

karriere/legacy

  • Tuesday, February 28, 2017
  • by fetzi
  • Repository
  • 2 Watchers
  • 3 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

    StyleCI, (*1)

Legacy Helpers

This package contains some convenient helper functions inspired by laravel helpers that can be used in a legacy application without IoC., (*2)

Tasks like sending a redirect or working with the session can be a real mess in plain php. Therefore this package provides helper functions to help with these problems., (*3)

Installation

You can install the package via composer, (*4)

composer require karriere/legacy

Bootstrapping

Place the initialize call after session_start and before helper usage:, (*5)

\Karriere\Legacy\Bootstrap::initialize();

Available Helpers

die dump

Dumps an arbitrary variable/value and stops execution of the script., (*6)

dd('any value');
dd($_GET);

session

Helper method for php session operations., (*7)

get session instance

session();

Returns an instance of Karriere\Legacy\Session., (*8)

get session value

Retrieve a value from the session, the call allows a second parameter that is returned as default value if no session data is found for the eky, (*9)

session('key');
session('key', 'no data');

store data in session

Store the given key-value pair in the session., (*10)

session(['key' => 'value']);

add flash message

Store a key-value pair only for the subsequent request., (*11)

session()->flash($key, $value);

Redirect

Helper method for sending redirects., (*12)

send redirect

The method allows a second parameter for status code, the default value is 302 (Found - Moved Temporarily)., (*13)

redirect('http://www.karriere.at')->send();
redirect('http://www.karriere.at', 301)->send();

redirect with flash message

The redirector allows to store flash messages before sending the actual redirect., (*14)

redirect('http://www.karriere.at')->with('status', 'something happened')->send();

License

Apache License 2.0 Please see LICENSE for more information., (*15)

The Versions

28/02 2017

dev-master

9999999-dev https://github.com/karriereat/legacy

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6

 

28/02 2017

v1.0.0

1.0.0.0 https://github.com/karriereat/legacy

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6

 

28/02 2017

dev-analysis-XlRlM9

dev-analysis-XlRlM9 https://github.com/karriereat/legacy

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6