Skip to content

Instantly share code, notes, and snippets.

@simensen
Created June 19, 2014 23:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save simensen/d1a0b81c389e439eb58e to your computer and use it in GitHub Desktop.
<?php
class AdrOrNotFramework
{
//
// ... does lots of routing and what not,
// your typical micro-framework nonsense...
//
public function redirectTo($url)
{
return new RedirectResponse($url);
}
}
class MyApp extends AdrOrNotFramework
{
public function routes()
{
$this->post('/whatever', function () {
//
// This is an Action...
//
// Is this ADR compatible?
return $this->redirecctTo('http://google.com');
});
}
}
<?php
class AdrOrNotFramework
{
}
class UtilityResponder
{
public static function redirectTo($url)
{
return new RedirectResponse($url);
}
}
class MyApp extends AdrOrNotFramework
{
public function routes()
{
$this->post('/whatever', function () {
//
// This is an Action...
//
// Is this ADR compatible?
return UtilityResponder::redirecctTo('http://google.com');
});
}
}
<?php
class AdrOrNotFramework
{
public function __construct()
{
$this->utilityResponder = new UtilityResponder();
}
}
class UtilityResponder
{
public function redirectTo($url)
{
return new RedirectResponse($url);
}
}
class MyApp extends AdrOrNotFramework
{
public function routes()
{
$this->post('/whatever', function () {
//
// This is an Action...
//
// Is this ADR compatible?
return $this->utilityResponder->redirecctTo('http://google.com');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment