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


PHP KFactory::identify方法代码示例

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


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

示例1: setLayout

	public function setLayout($layout)
    {
        $identifier = KFactory::identify('md://admin/com.learn.docs.pages.'.$layout);

        $this->_layout = $identifier;
        return $this;
    }
开发者ID:raeldc,项目名称:com_learn,代码行数:7,代码来源:html.php

示例2: setView

 /**
  * Method to set a view object attached to the template
  *
  * @param   mixed   An object that implements KObjectIdentifiable, an object that 
  *                  implements KIndentifierInterface or valid identifier string
  * @throws  KDatabaseRowsetException    If the identifier is not a table identifier
  * @return  KTemplateAbstract
  */
 public function setView($view)
 {
     if (!$view instanceof KViewAbstract) {
         $identifier = KFactory::identify($view);
         if ($identifier->name != 'html') {
             throw new KViewException('Identifier: ' . $identifier . ' is not a view identifier');
         }
         $view = KFactory::get($identifier);
     }
     $this->_view = $view;
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:template.php

示例3: setTable

 /**
  * Method to set a table object attached to the rowset
  *
  * @param	mixed	An object that implements KObjectIdentifiable, an object that
  *                  implements KIndentifierInterface or valid identifier string
  * @throws	KDatabaseRowException	If the identifier is not a table identifier
  * @return	KDatabaseRowsetAbstract
  */
 public function setTable($table)
 {
     if (!$table instanceof KDatabaseTableAbstract) {
         $identifier = KFactory::identify($table);
         if ($identifier->path[0] != 'table') {
             throw new KModelException('Identifier: ' . $identifier . ' is not a table identifier');
         }
         $table = KFactory::get($identifier);
     }
     $this->_table = $table;
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:table.php

示例4: loadIdentifier

	public function loadIdentifier($template, $data = array(), $process = true)
	{
	    //Identify the template
	    $identifier = KFactory::identify($template);

	    // Find the template 
		$file = KLoader::path($identifier);
	    
		if ($file === false) {
			throw new KTemplateException('Template "'.$identifier->name.'" not found');
		}
		
		// Load the file
		$this->loadFile($file, $data, $process);
		
		return $this;
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:17,代码来源:markdown.php

示例5: setTemplate

 /**
  * Method to set a template object attached to the view
  *
  * @param   mixed   An object that implements KObjectIdentifiable, an object that 
  *                  implements KIndentifierInterface or valid identifier string
  * @throws  KDatabaseRowsetException    If the identifier is not a table identifier
  * @return  KViewAbstract
  */
 public function setTemplate($template)
 {
     if (!$template instanceof KTemplateAbstract) {
         $identifier = KFactory::identify($template);
         if ($identifier->path[0] != 'template') {
             throw new KViewException('Identifier: ' . $identifier . ' is not a template identifier');
         }
         $this->_template = KFactory::get($identifier);
     } else {
         $this->_template = $template;
     }
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:21,代码来源:template.php

示例6: setController

 /**
  * Method to set a controller object attached to the dispatcher
  *
  * @param	mixed	An object that implements KObjectIdentifiable, an object that
  *                  implements KIndentifierInterface or valid identifier string
  * @throws	KDatabaseRowsetException	If the identifier is not a controller identifier
  * @return	KDispatcherAbstract
  */
 public function setController($controller)
 {
     if (!$controller instanceof KControllerAbstract) {
         $identifier = KFactory::identify($controller);
         if ($identifier->path[0] != 'controller') {
             throw new KDispatcherException('Identifier: ' . $identifier . ' is not a controller identifier');
         }
         $this->_controller = $identifier;
     }
     $this->_controller = $controller;
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:abstract.php

示例7: getBehavior

	/**
     * Get a behavior by identifier
     *
     * @return KControllerBehaviorAbstract
     */
    public function getBehavior($behavior, $config = array())
    {
       if(!($behavior instanceof KIdentifier))
       {
            //Create the complete identifier if a partial identifier was passed
           if(is_string($behavior) && strpos($behavior, '.') === false )
           {
               $identifier = clone $this->_identifier;
               $identifier->path = array('controller', 'behavior');
               $identifier->name = $behavior;
           }
           else $identifier = KFactory::identify($behavior);
       }
           
       if(!isset($this->_behaviors[$identifier->name])) {
           $behavior = KControllerBehavior::factory($identifier, array_merge($config, array('mixer' => $this)));
       } else {
           $behavior = $this->_behaviors[$identifier->name];
       }
       
       return $behavior;
    }
开发者ID:raeldc,项目名称:com_learn,代码行数:27,代码来源:abstract.php

示例8: setModel

 /**
  * Method to set a model object attached to the view
  *
  * @param	mixed	An object that implements KObjectIdentifiable, an object that 
  *                  implements KIndentifierInterface or valid identifier string
  * @throws	KViewException	If the identifier is not a table identifier
  * @return	KViewAbstract
  */
 public function setModel($model)
 {
     if (!$model instanceof $model) {
         $identifier = KFactory::identify($model);
         if ($identifier->path[0] != 'model') {
             throw new KViewException('Identifier: ' . $identifier . ' is not a model identifier');
         }
         $model = KFactory::get($identifier);
     }
     $this->_model = $model;
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:abstract.php

示例9: setModel

	/**
	 * Method to set a model object attached to the controller
	 *
	 * @param	mixed	An object that implements KObjectIdentifiable, an object that
	 *                  implements KIdentifierInterface or valid identifier string
	 * @throws	KControllerException	If the identifier is not a model identifier
	 * @return	object	A KModelAbstract object or a KIdentifier object
	 */
	public function setModel($model)
	{
		if(!($model instanceof KModelAbstract))
		{
	        if(is_string($model) && strpos($model, '.') === false ) 
		    {
			    // Model names are always plural
			    if(KInflector::isSingular($model)) {
				    $model = KInflector::pluralize($model);
			    } 
		        
			    $identifier			= clone $this->_identifier;
			    $identifier->path	= array('model');
			    $identifier->name	= $model;
			}
			else $identifier = KFactory::identify($model);
		    
			if($identifier->path[0] != 'model') {
				throw new KControllerException('Identifier: '.$identifier.' is not a model identifier');
			}

			$model = $identifier;
		}
		
		$this->_model = $model;
		
		return $this->_model;
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:36,代码来源:resource.php

示例10: getHelper

	/**
	 * Get a template helper
	 *
	 * @param	mixed	An object that implements KObjectIdentifiable, an object that
	 *                  implements KIdentifierInterface or valid identifier string
	 * @param	mixed	Parameters to be passed to the helper
	 * @return 	KTemplateHelperInterface
	 */
	public function getHelper($helper)
	{	
		//Create the complete identifier if a partial identifier was passed
		if(is_string($helper) && strpos($helper, '.') === false ) 
		{
            $identifier = clone $this->getIdentifier();
            $identifier->path = array('template','helper');
            $identifier->name = $helper;
		}
		else $identifier = KFactory::identify($helper);
	 
		//Create the template helper
		$helper = KTemplateHelper::factory($identifier, array('template' => $this));
		
		return $helper;
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:24,代码来源:abstract.php

示例11: setTemplate

    /**
     * Method to set a template object attached to the view
     *
     * @param   mixed   An object that implements KObjectIdentifiable, an object that 
     *                  implements KIdentifierInterface or valid identifier string
     * @throws  KDatabaseRowsetException    If the identifier is not a table identifier
     * @return  KViewAbstract
     */
    public function setTemplate($template)
    {
        if(!($template instanceof KTemplateAbstract))
        {
            if(is_string($template) && strpos($template, '.') === false ) 
		    {
			    $identifier = clone $this->_identifier; 
                $identifier->path = array('template');
                $identifier->name = $template;
			}
			else $identifier = KFactory::identify($template);
            
            if($identifier->path[0] != 'template') {
                throw new KViewException('Identifier: '.$identifier.' is not a template identifier');
            }
        
            $template = $identifier;
        } 
        
        $this->_template = $template;
            
        return $this;
    }
开发者ID:raeldc,项目名称:com_learn,代码行数:31,代码来源:template.php

示例12: setMenubar

	/**
	 * Method to set a menubar object attached to the controller
	 *
	 * @param	mixed	An object that implements KObjectIdentifiable, an object that
	 *                  implements KIdentifierInterface or valid identifier string
	 * @throws	KControllerBehaviorException	If the identifier is not a view identifier
	 * @return	KControllerToolbarAbstract 
	 */
    public function setMenubar($menubar)
    {
        if(!($menubar instanceof KControllerToolbarAbstract))
		{
			if(is_string($menubar) && strpos($menubar, '.') === false ) 
		    {
			    $identifier         = clone $this->_identifier;
                $identifier->path   = array('controller', 'toolbar');
                $identifier->name   = $menubar;
			}
			else $identifier = KFactory::identify($menubar);
			
			if($identifier->path[1] != 'toolbar') {
				throw new KControllerBehaviorException('Identifier: '.$identifier.' is not a toolbar identifier');
			}

			$menubar = $identifier;
		}
		
		$this->_menubar = $menubar;
        
        return $this;
    }
开发者ID:raeldc,项目名称:com_learn,代码行数:31,代码来源:commandable.php

示例13: setView

 /**
  * Method to set a view object attached to the controller
  *
  * @param	mixed	An object that implements KObjectIdentifiable, an object that
  *                  implements KIndentifierInterface or valid identifier string
  * @throws	KDatabaseRowsetException	If the identifier is not a view identifier
  * @return	KControllerAbstract
  */
 public function setView($view)
 {
     if (!$view instanceof KViewAbstract) {
         $identifier = KFactory::identify($view);
         if ($identifier->path[0] != 'view') {
             throw new KControllerException('Identifier: ' . $identifier . ' is not a view identifier');
         }
         $this->_view = $view;
     }
     $this->_view = $view;
     return $this;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:view.php

示例14: setTable

    /**
     * Method to set a table object attached to the model
     *
     * @param   mixed   An object that implements KObjectIdentifiable, an object that
     *                  implements KIdentifierInterface or valid identifier string
     * @throws  KDatabaseRowsetException    If the identifier is not a table identifier
     * @return  KModelTable
     */
    public function setTable($table)
	{
		if(!($table instanceof KDatabaseTableAbstract))
		{
			if(is_string($table) && strpos($table, '.') === false ) 
		    {
		        $identifier         = clone $this->_identifier;
		        $identifier->path   = array('database', 'table');
		        $identifier->name   = KInflector::tableize($table);
		    }
		    else  $identifier = KFactory::identify($table);
		    
			if($identifier->path[1] != 'table') {
				throw new KDatabaseRowsetException('Identifier: '.$identifier.' is not a table identifier');
			}

			$table = $identifier;
		}

		$this->_table = $table;

		return $this;
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:31,代码来源:table.php

示例15: setSelector

	public function setSelector($selector)
	{
		if (!($this->_selector instanceof ComLearnDatabaseTableSelectorDefault))
		{
			if(is_string($selector) && strpos($selector, '.') === false ) 
		    {
		        $identifier         = clone $this->_identifier;
		        $identifier->path   = array('database', 'table', 'selector');
		        $identifier->name   = $selector;
		    }
		    else  $identifier = KFactory::identify($selector);

			if($identifier->path[2] != 'selector') {
				throw new KDatabaseRowsetException('Identifier: '.$identifier.' is not a selector identifier');
			}

			$selector = $identifier;
		}

		$this->_selector = $selector;

		return $this;
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:23,代码来源:nosql.php


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