Source for file jSelectorActFast.class.php

Documentation is available at jSelectorActFast.class.php

  1. <?php
  2. /**
  3. * see jISelector.iface.php for documentation about selectors.
  4. @package     jelix
  5. @subpackage  core_selector
  6. @author      Laurent Jouanneau
  7. @contributor Thibault PIRONT < nuKs >
  8. @copyright   2005-2007 Laurent Jouanneau
  9. @copyright   2007 Thibault PIRONT
  10. @link        http://www.jelix.org
  11. @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  12. */
  13.  
  14. /**
  15.  * Special Action selector for jcoordinator
  16.  * Don't use it ! Only for internal purpose.
  17.  * @internal
  18.  * @package    jelix
  19.  * @subpackage core_selector
  20.  */
  21. class jSelectorActFast extends jSelectorModule {
  22.     protected $type = 'act';
  23.     public $request = '';
  24.     public $controller = '';
  25.     public $method='';
  26.     protected $_dirname='actions/';
  27.  
  28.     /**
  29.      */
  30.     function __construct($request$module$action){
  31.         $this->module = $module;
  32.         $r explode(':',$action);
  33.         if(count($r== 1){
  34.             $this->controller = 'default';
  35.             $this->method = $r[0]==''?'index':$r[0];
  36.         }else{
  37.             $this->controller = $r[0]=='' 'default':$r[0];
  38.             $this->method = $r[1]==''?'index':$r[1];
  39.         }
  40.         if (substr($this->method,0,2== '__')
  41.             throw new jExceptionSelector('jelix~errors.selector.method.invalid'$this->toString());
  42.         $this->resource = $this->controller.':'.$this->method;
  43.         $this->request = $request;
  44.         $this->_createPath();
  45.     }
  46.  
  47.     protected function _createPath(){
  48.         global $gJConfig;
  49.         if(!isset($gJConfig->_modulesPathList[$this->module])){
  50.             throw new jExceptionSelector('jelix~errors.selector.module.unknow'$this->toString());
  51.         }else{
  52.             $this->_path = $gJConfig->_modulesPathList[$this->module].'controllers/'.$this->controller.'.'.$this->request.'.php';
  53.         }
  54.     }
  55.  
  56.     protected function _createCachePath(){
  57.         $this->_cachePath = '';
  58.     }
  59.  
  60.     public function toString($full=false){
  61.         if($full)
  62.             return $this->type.':'.$this->module.'~'.$this->resource.'@'.$this->request;
  63.         else
  64.             return $this->module.'~'.$this->resource.'@'.$this->request;
  65.     }
  66.  
  67.     public function getClass(){
  68.         return $this->controller.'Ctrl';
  69.     }
  70.  
  71. }

Documentation generated on Thu, 22 Mar 2012 22:17:04 +0100 by phpDocumentor 1.4.3