PHP code example of coreplex / core

1. Go to this page and download the library: Download coreplex/core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

coreplex / core example snippets


"coreplex/core": "~0.1"

'providers' => array(

  Coreplex\Core\CoreServiceProvider::class,

);

$renderer = new Coreplex\Core\Renderer\Renderer(); 

public function __construct(Coreplex\Core\Contracts\Renderer $renderer)
{
    $this->renderer = $renderer;
}

$renderer = app('coreplex.core.renderer');

$view = $renderer->make('path/to/view.php');
$view = $renderer->make('path/to/view.php', ['foo' => 'bar']);

$config =  = new Coreplex\Core\Session\Native($config);

public function __construct(Coreplex\Core\Contracts\Session $session)
{
    $this->session = $session;
}

$session = app('coreplex.core.session');

$session->put('foo', 'bar');

$session->flash('foo', 'bar');

$session->get('foo');

$session->has('foo');

$session->forget('foo');