ZF\Console\Application::setupAutocompleteCommand PHP 메소드

setupAutocompleteCommand() 보호된 메소드

Creates the route, and maps the command.
protected setupAutocompleteCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher )
$routeCollection ZF\Console\RouteCollection
$dispatcher ZF\Console\DispatcherInterface
    protected function setupAutocompleteCommand(RouteCollection $routeCollection, DispatcherInterface $dispatcher)
    {
        $routeCollection->addRouteSpec(['name' => 'autocomplete', 'description' => 'Shows how to activate autocompletion of this command for your login shell', 'short_description' => 'Command autocompletion setup']);
        $dispatcher->map('autocomplete', function ($route, $console) {
            ob_start();
            include __DIR__ . '/../views/autocomplete.phtml';
            $content = ob_get_contents();
            ob_end_clean();
            return $console->write($content);
        });
    }

Usage Example

예제 #1
0
파일: Application.php 프로젝트: gianarb/pan
 protected function setupAutocompleteCommand(RouteCollection $routeCollection, Dispatcher $dispatcher)
 {
     if ($dispatcher instanceof AppDispatcher) {
         return parent::setupAutocompleteCommand($routeCollection, $dispatcher);
     }
 }