Paperyard
Public Member Functions | List of all members
Paperyard\Controllers\Misc\Shell Class Reference
Inheritance diagram for Paperyard\Controllers\Misc\Shell:
Paperyard\Controllers\BasicController

Public Member Functions

 __construct (Twig $view, LoggerInterface $logger, Messages $flash)
 
 __invoke (Request $request, Response $response, $args)
 
 render ()
 
- Public Member Functions inherited from Paperyard\Controllers\BasicController
 getPlugins ()
 
 registerPlugin ($name, $type=PluginType::NORMAL)
 
 getLanguageFlag ()
 

Additional Inherited Members

- Protected Attributes inherited from Paperyard\Controllers\BasicController
 $view
 
 $logger
 
 $flash
 

Detailed Description

Definition at line 12 of file Shell.php.

Constructor & Destructor Documentation

Paperyard\Controllers\Misc\Shell::__construct ( Twig  $view,
LoggerInterface  $logger,
Messages  $flash 
)

Definition at line 14 of file Shell.php.

15  {
16  $this->view = $view;
17  $this->logger = $logger;
18  $this->flash = $flash;
19 
20  $this->registerPlugin('shell-log');
21  }
registerPlugin($name, $type=PluginType::NORMAL)

Member Function Documentation

Paperyard\Controllers\Misc\Shell::__invoke ( Request  $request,
Response  $response,
  $args 
)

Definition at line 23 of file Shell.php.

24  {
25  if ($request->isXhr()) {
26  // provide entities
27  return $response->withJson(\Paperyard\Models\Log\Shell::where('id', '>=', (int)$request->getAttribute('since'))->orderBy('id', 'DESC')->take((int)$request->getAttribute('count'))->get());
28  } else {
29  // provide view
30  $this->view->render($response, 'misc/shell.twig', $this->render());
31  }
32  }
Paperyard\Controllers\Misc\Shell::render ( )

render

Returns
array data to render the view

Definition at line 38 of file Shell.php.

39  {
40  return array(
41  'plugins' => parent::getPlugins(),
42  'languageFlag' => parent::getLanguageFlag()
43  );
44  }

The documentation for this class was generated from the following file: