Skip to content

Instantly share code, notes, and snippets.

@devosc
Last active August 29, 2015 14:08
Show Gist options
  • Save devosc/a731cf699b7b0e371d34 to your computer and use it in GitHub Desktop.
Save devosc/a731cf699b7b0e371d34 to your computer and use it in GitHub Desktop.
Call function
<?php
/**
*
*/
use Blog\Blog;
use Framework\Application\App;
use Framework\View\Manager\ViewManager;
use Request\Request;
use Response\Response;
/**
*
*/
include __DIR__ . '/../init.php';
/**
*
*/
class Controller
{
protected $blog;
function valid(Request $request, $strict)
{
var_dump($strict);
return $this;
}
function add(Response $response, $date_created)
{
var_dump($date_created);
$this->blog = new Blog;
return $this;
}
function response(ViewManager $vm, Response $response, $args)
{
var_dump($this->blog, $args);
return $response;
}
}
/**
*
*/
$web = new App(include __DIR__ . '/../config/web.php');
$response = $web->call(
'Controller.valid.add.response',
['date_created' => time(), 'strict' => true]
);
var_dump($response instanceof Response);
@devosc
Copy link
Author

devosc commented Oct 30, 2014

boolean true

int 1414690433

object(Blog\Blog)[100]

array (size=2)
  'date_created' => int 1414690433
  'strict' => boolean true

boolean true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment