当前位置: 首页>>代码示例>>PHP>>正文


PHP Registry::get_instance方法代码示例

本文整理汇总了PHP中Registry::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::get_instance方法的具体用法?PHP Registry::get_instance怎么用?PHP Registry::get_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registry的用法示例。


在下文中一共展示了Registry::get_instance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($uri = "")
 {
     // default request uri
     if (trim($uri) == "") {
         $uri = $_SERVER['REQUEST_URI'];
     }
     // esplodo uri e filtro
     $elements = explode("/", $uri);
     $elements = array_filter($elements);
     array_shift($elements);
     // associo a proprieta
     $this->_controller = !empty($elements[0]) ? $elements[0] : DEFAULT_CONTROLLER;
     $this->_method = !empty($elements[1]) ? $elements[1] : "index";
     $args = array();
     for ($i = 2; $i < count($elements); $i++) {
         $args[] = $elements[$i];
     }
     $this->_args = $args;
     // salvo i valori intepretati nel registro
     $this->registry = Registry::get_instance();
     $r = array();
     $r['controller'] = $this->getController();
     $r['method'] = $this->getMethod();
     $r['args'] = $this->getArgs();
     // salvo nel registro
     // i dati recuperati dall'uri
     $this->registry->request = $r;
 }
开发者ID:sg4r3z,项目名称:umvc,代码行数:28,代码来源:class.request.php

示例2: __construct

 function __construct()
 {
     Session::init();
     $this->registry = Registry::get_instance();
     // létrehozzuk a view objektumot és hozzárendeljük a $view tulajdonsághoz
     $this->view = new View();
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:7,代码来源:controller.php

示例3: __construct

 /**
  * Initialize class, retrieve location data from DB, generate calendar dates to query against
  * @param string $apiKey authentication string used used query Hotwire.com
  */
 function __construct($apiKey)
 {
     $this->apiKey = $apiKey;
     $registry = Registry::get_instance();
     $this->dataHandler = $registry->get('DataHandler');
     $this->locations = $this->dataHandler->get_airports();
     $this->queryDates = $this->generate_query_dates();
 }
开发者ID:RobGriggs,项目名称:ReadySetJet-2x,代码行数:12,代码来源:CarAndHotelAPI.php

示例4: get_page

 public static function get_page()
 {
     $registry = Registry::get_instance();
     // ritorna il primo elemento, che considero
     // l'indice di paginazione
     if (count($registry->request['args']) > 0) {
         return intval($registry->request['args'][0]);
     }
     return 0;
 }
开发者ID:sg4r3z,项目名称:umvc,代码行数:10,代码来源:class.paginator.php

示例5: __construct

 function __construct()
 {
     // adatbáziskapcsolat létrehozása
     $this->connect = db::get_connect();
     $this->registry = Registry::get_instance();
     // hozzárendeljük a query tulajdonsághoz a Query objektumot
     // ez a query tulajdonság a gyerek model-ek bármelyik metódusában elérhető
     // megkapja paraméterként az adatbáziskapcsolatot
     $this->query = new Query($this->connect);
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:10,代码来源:model.php

示例6: load

 public static function load()
 {
     /**
      * inizializzo la connessione al DB
      */
     $db = new db(CONNECTION_STRING, DB_Username, DB_Password);
     // inizializzo il registro
     self::$registry = Registry::get_instance();
     // carico tutte le classi di validazione
     self::__load_validators();
     // carico tutti i modelli
     self::__load_models($db);
 }
开发者ID:sg4r3z,项目名称:umvc,代码行数:13,代码来源:class.loader.php

示例7: __construct

 public function __construct()
 {
     // Registry objektum hozzárendelése egy tulajdonsághoz
     $this->registry = Registry::get_instance();
     // url elemzése és elemeinek bevitele a registrybe
     $this->uri_parser();
     // Beállítjuk, hogy az üzenetek melyik modulra vonatkozzanak (message_site vagy message_admin)
     Message::set_area($this->registry->area);
     // Betöltjük az aktuális nyelvnek megfelelő üzenet fájlt
     Message::load('messages_' . $this->registry->area, $this->registry->lang);
     // router betöltése (controller, action és paraméterek megadása)
     $this->load_router();
     //var_dump($this->registry);
     //die('');
     // controller file betöltése és a megfelelő action behívása
     $this->load_controller();
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:17,代码来源:application.php

示例8: set_attributes

 /**
  * Osztály tulajdonságainak beállítása
  *
  */
 private static function set_attributes()
 {
     $registry = Registry::get_instance();
     if ($registry->area == 'site') {
         self::$expire_time = Config::get('session.expire_time_site', 3600);
         self::$element_name = 'user_site_last_activity';
         self::$logged_in = 'user_site_logged_in';
         self::$target_url = '';
     }
     if ($registry->area == 'admin') {
         self::$expire_time = Config::get('session.expire_time_admin', 3600);
         self::$element_name = 'user_last_activity';
         self::$logged_in = 'user_logged_in';
         self::$target_url = 'login';
     }
     self::$site_url = $registry->site_url;
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:21,代码来源:auth_class.php

示例9: __construct

 /**
  * function __construct
  * @param Registry instance
  */
 public function __construct()
 {
     $this->registry = Registry::get_instance();
 }
开发者ID:sg4r3z,项目名称:umvc,代码行数:8,代码来源:abstract.appcontroller.php

示例10: Request

<?php
	/**
	 * carico tutto il framework
	 */
	include("autoload.inc.php");
	/**
	 * implementazione di acl
	 */
	$registry = Registry::get_instance();
	$sys_user = $registry -> object['sys_user'];

	// recupero la richiesta
	$request = new Request();
	
	$method = $registry -> request['method'];
	$controller = $registry -> request['controller'];
		
	// se sono loggato
	// ruota verso il sistema
	if($sys_user -> checkLogin()){
			
		// array di acl
		// devo evitare l'accessoa questo array se loggatto
		$permitted = array(
							array("controller" => "sys_user", "method" => "do_login"),
							array("controller" => "sys_user", "method" => "login")
						  );

		$is_allowed = $sys_user -> permit($controller,$method,$permitted);
	
		// se non cerco di accedere 
开发者ID:sg4r3z,项目名称:umvc,代码行数:31,代码来源:index.php

示例11: url_with_language

 /**
  *	Visszaadja a jelenlegi url-t a paraméterben megadott nyelvi kóddal módosítva
  *
  *	@param	String	$lang_code	(nyelvi kód)
  *	@return	String
  */
 public static function url_with_language($lang_code = 'hu')
 {
     $registry = Registry::get_instance();
     $lang = $lang_code == 'hu' ? '' : $lang_code . '/';
     $area = $registry->area == 'site' ? '' : $registry->area . '/';
     return BASE_URL . $area . $lang . $registry->uri;
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:13,代码来源:util_class.php

示例12: view

		public function view(){
			
			// recupero i dati dal registro
			$registry = Registry::get_instance();
			$id = $registry -> request['args'][0];			

			if($id > 0){
				
				$sys_user = $this -> registry -> object['sys_user'];
				$sys_userrole = $this -> registry -> object['sys_userrole'];
			
				// mostro la view del documento
				try{
					$item = $sys_user -> get($id);
					$item_role = $sys_userrole -> get($item -> sys_userrole_fk);
					$view = new View("sys_user/view");
					$view -> title = "Dettaglio Utente";	   
					$view -> row = $item;
					$view -> item_role = $item_role;
					$view -> link_edit_password = SITE_URL.US."sys_user".US."editPwd".US;
					$view -> render();
				}
				
				// documento non trovato
				catch(Exception $e){
					
					$data = array();
					$data['error_string'] = "Utente non trovato";
					$data['debug_string'] = print_r($e,true);
					
					$this -> error_404($data);
					
				}
			}
			// id non è un'intero
			else{
				
				$data = array();
				$data['error_string'] = "L'identificativo passato non è intero"; 
				
				$this -> error_404($data);
			}
		
		}
开发者ID:sg4r3z,项目名称:umvc,代码行数:44,代码来源:controller.sys_user.php

示例13: __construct

 /**
  *	Constructor
  */
 function __construct()
 {
     $this->registry = Registry::get_instance();
     $this->area = $this->registry->area;
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:8,代码来源:view.php


注:本文中的Registry::get_instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。