.

BinariesBaseController Class Reference
[Binaries]

Defines a view route for binaries. More...

Inheritance diagram for BinariesBaseController:
ControllerBase IController IEventSink

List of all members.

Public Member Functions

  action_binaries_view ($page_data, $id)
  Show binary.
  before_action ()
  Activates includes before action to reduce cache memory.
  get_routes ()
  Return array of IDispatchToken this controller takes responsability.

Protected Member Functions

  get_route_decorators ()
  Return Decorators for binaries routes.

Detailed Description

Defines a view route for binaries.

Author:
Gerd Riesselmann

Definition at line 8 of file binaries.basecontroller.php.


Member Function Documentation

BinariesBaseController::action_binaries_view ( page_data,
id  
)

Show binary.

Parameters:
$page_data  PageData
$id  ID of binary

Definition at line 42 of file binaries.basecontroller.php.

00042                                                               {
00043                 $binary = Binaries::get($id);
00044                 if (empty($binary)) {
00045                         return CONTROLLER_NOT_FOUND;    
00046                 }
00047                 
00048                 $view = ViewFactory::create_view(ViewFactoryMime::MIME, 'binaries/view', $page_data);
00049                 $view->assign(MimeView::MIMETYPE, $binary->mimetype);
00050                 $view->assign('binary', $binary);
00051                 $view->render();
00052         }
BinariesBaseController::before_action (  ) 

Activates includes before action to reduce cache memory.

Reimplemented from ControllerBase.

Definition at line 32 of file binaries.basecontroller.php.

00032                                         {
00033                 Load::models('binaries');               
00034         }
BinariesBaseController::get_route_decorators (  )  [protected]

Return Decorators for binaries routes.

Returns:
mixed

Definition at line 25 of file binaries.basecontroller.php.

00025                                                   {
00026                 return array(new BinariesCacheManager());
00027         }
BinariesBaseController::get_routes (  ) 

Return array of IDispatchToken this controller takes responsability.

Reimplemented from ControllerBase.

Definition at line 13 of file binaries.basecontroller.php.

00013                                      {
00014                 $ret = array(
00015                         'view' => new ParameterizedRoute('binaries/{id:ui>}', $this, 'binaries_view', $this->get_route_decorators()),
00016                 );
00017                 return $ret;
00018         }

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