Skip to content

Commit

Permalink
Fixed parameters for files included via routes
Browse files Browse the repository at this point in the history
  • Loading branch information
brcontainer committed Jul 31, 2023
1 parent 0a24d0e commit ab54f01
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vendor/Teeny.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
*/
class Teeny
{
private $code = 200;
private $pathinfo;

private $codes = array();
private $routes = array();
private $paramRoutes = array();
private $paramCallbacks = array();

private $code = 200;
private $pathinfo;

private $hasParams = false;
private $paramPatterns = array(
Expand Down Expand Up @@ -265,7 +264,7 @@ private function dispatch($callback, $code, $params)
echo $callback($code);
}
} elseif (is_string($callback) && strpos($callback, '.') !== false) {
TeenyLoader($this, $callback);
TeenyLoader($this, $callback, $params);
} elseif ($params !== null) {
echo $callback($params);
} else {
Expand All @@ -289,11 +288,12 @@ private function builtinFile()
/**
* Require file
*
* @param Teeny $app Teeny (or custom) context
* @param string $callback file required
* @param Teeny $app Teeny (or custom) context
* @param string $callback File required
* @param array $params Params from route pattern
* @return mixed
*/
function TeenyLoader(Teeny $app, $callback)
function TeenyLoader(Teeny $app, $callback, $params)
{
return require $callback;
}

0 comments on commit ab54f01

Please sign in to comment.