Skip to content

Instantly share code, notes, and snippets.

View devosc's full-sized avatar

devosc

View GitHub Profile
@devosc
devosc / Service.php
Created March 23, 2015 14:56
ArrayAccess Container Support
<?php
/**
*
*/
namespace Framework\Service\Container;
use Framework\Config\ArrayAccess;
use Framework\Config\Configuration;
@devosc
devosc / ViewModel.php
Created July 20, 2015 06:35
ViewModel Controller
<?php
namespace Home;
use Mvc5\View\Model\Base;
use Mvc5\View\Model\Plugin;
use Mvc5\View\Model\ViewModel;
use Mvc5\View\ViewPlugin;
class Model
<?php
$plugin = $this->plugin($plugin, function($plugin) use($args, $callback) {
if (!is_callable($plugin)) {
return $this->call('service:event', [$plugin]);
}
return $plugin;
});
@devosc
devosc / ManageService.php
Last active October 29, 2015 22:36
Module Service Access
public function create($config, array $args = [], callable $callback = null)
{
if (!$config) {
return $config;
}
if (is_string($config)) {
$name = explode(Args::SERVICE_SEPARATOR, $config);
$config = array_shift($name);
@devosc
devosc / context.php
Created August 19, 2017 16:52
Context
<?php
/**
*
*/
include __DIR__ . '/../init.php';
use Mvc5\App;
use Mvc5\Arg;
use Mvc5\Http\Request;
use Mvc5\Http\Response;
@devosc
devosc / middleware_args.php
Last active August 20, 2017 16:28
Middleware Args
<?php
/**
*
*/
namespace Mvc5\Service;
use Mvc5\Arg;
use Mvc5\Signal;
<?php
trait base_trait
{
protected $prop = [];
function __construct()
{
var_dump($this->prop);
}
@devosc
devosc / Config.php
Last active March 25, 2018 18:42
multiple has get
<?php
/**
*
*/
namespace Mvc5\Config;
trait Config
{
/**