ZF\Console\Route::matchedParam PHP Method

matchedParam() public method

Was the parameter matched?
public matchedParam ( string $param ) : boolean
$param string
return boolean
    public function matchedParam($param)
    {
        if (!is_array($this->matches)) {
            return false;
        }
        return array_key_exists($param, $this->matches);
    }

Usage Example

Example #1
0
 public function __invoke(Route $route, Console $console) : int
 {
     $message = 'Creating tag cloud';
     $length = strlen($message);
     $width = $console->getWidth();
     $console->write($message, Color::BLUE);
     if (!$route->matchedParam('output')) {
         return $this->reportError($console, $width, $length, 'Missing output file');
     }
     $output = $route->getMatchedParam('output');
     $cloud = $this->mapper->fetchTagCloud();
     $markup = sprintf("<h4>Tag Cloud</h4>\n<div class=\"cloud\">%s</div>", $cloud->render());
     file_put_contents($output, $markup);
     return $this->reportSuccess($console, $width, $length);
 }
All Usage Examples Of ZF\Console\Route::matchedParam