coreplex/core
| Install | |
|---|---|
composer require coreplex/core |
|
| Latest Version: | v0.1.3 |
| PHP: | >=5.4.0 |
| License: | MIT |
| Last Updated: | Sep 22, 2015 |
| Links: | GitHub · Packagist |
Core

A collection of core classes for the coreplex packages.
Installation
This package requires PHP 5.4+, and includes a Laravel 5 Service Provider.
We recommend installing the package through composer. You can either call composer require coreplex/core in your
command line, or add the following to your composer.json and then run either composer install or composer update
to download the package.
"coreplex/core": "~0.1"
Laravel 5 Integration
To use the package with Laravel 5 firstly add the core service provider to the list of service providers in
app/config/app.php.
'providers' => array(
Coreplex\Core\CoreServiceProvider::class,
);
The publish the config file by running php artisan vendor:publish.
Using the Renderer
To get started with the renderer, firstly you need to initialise the class.
$renderer = new Coreplex\Core\Renderer\Renderer();
To access the renderer from laravel just access it via the IOC container by its contract or its alias.
public function __construct(Coreplex\Core\Contracts\Renderer $renderer)
{
$this->renderer = $renderer;
}
$renderer = app('coreplex.core.renderer');
Rendering Templates
To render a view to a string call the make method on the renderer. You can also pass dynamic data to the view by
passing an array of key value pairs as a second parameter.
$view = $renderer->make('path/to/view.php');
$view = $renderer->make('path/to/view.php', ['foo' => 'bar']);
Using the Session
To get started with the session class with firstly need to initialise it.
$config = require('path/to/coreplex.php');
$session = new Coreplex\Core\Session\Native($config);
Or with laravel just resolve it from the IOC container.
public function __construct(Coreplex\Core\Contracts\Session $session)
{
$this->session = $session;
}
$session = app('coreplex.core.session');
Add Item
To add an item to the session use the put method.
$session->put('foo', 'bar');
Or to flash an value for the next request use the flash method.
$session->flash('foo', 'bar');
Getting Items
To get an item from the session use the get method.
$session->get('foo');
You may also want to check if an item exists in the session; to do so use the has method.
$session->has('foo');
Removing Items
To remove an item from the session use the forget method.
$session->forget('foo');
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v0.1.3 | >=5.4.0 | MIT | |
| v0.1.2 | >=5.4.0 | MIT | |
| v0.1.1 | >=5.4.0 | MIT | |
| v0.1 | >=5.4.0 | MIT |