Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

Source for file AmiSample_Frn.php

Documentation is available at AmiSample_Frn.php

  • <?php
  • /**
  •  * @copyright  Amiro.CMS. All rights reserved.
  •  * @category   AMI
  •  * @package    Module_Sample
  •  * @since      5.12.0
  •  * @filesource
  •  * @version    $Id: AmiSample_Frn.php 61273 2013-08-07 10:47:54Z Leontiev Anton $
  •  */
  •  
  • /**
  •  * Sample module front action controller.
  •  *
  •  * @package    Module_Sample
  •  * @subpackage Controller
  •  * @resource   ami_sample/module/controller/frn <code>AMI::getResource('ami_sample/module/controller/frn')</code>
  •  */
  •      /**
  •       * View
  •       *
  •       * @var AmiSample_ListViewFrn 
  •       */
  •     protected $oView;
  •  
  •     /**
  •      * Constructor.
  •      *
  •      * @param array $aPluginParams  Plugin parameters.
  •      */
  •     public function __construct(array $aPluginParams){
  •         // Module view
  •         $this->oView AMI::getResource($this->getModId('/list/view/frn');
  •         $this->oView->setScope(
  •             array(
  •                 'templates_path' => $aPluginParams['templates_path']
  •             )
  •         );
  •  
  •         /**
  •          * Prepare list model
  •          *
  •          * @var AMI_ModTableList 
  •          */
  •         $oModelList AMI::getResourceModel($this->getModId('/table')->getList();
  •  
  •         // Model initializing
  •         $oModelList->addColumns(array('id''nickname''birth'));
  •  
  •         // Set initialized model
  •         $this->oView->setModel($oModelList);
  •     }
  •  
  •     /**
  •      * Returns HTML content.
  •      *
  •      * @return string 
  •      */
  •     public function getResponse(){
  •         return $this->oView->get();
  •     }
  •  
  •     /**
  •      * Returns module id.
  •      *
  •      * @return string 
  •      */
  •     protected function getModId(){
  •         return AMI::getModId(get_class($this));
  •     }
  • }