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


PHP Localization::add_strings_table方法代码示例

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


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

示例1: render_component

 /**
  *	@short Renders a view from a controller other than self.
  *	@details This method renders a view from a controller other than self,
  *	for example when embedding a view into another view.
  *
  *	The <tt>params</tt> array has the same semantics of the <tt>render</tt> method,
  *	with the following additions:
  *
  *	<tt>controller</tt>: the name of the controller responsible for the view (defaults to self).
  *	@param params Parameters defining how the rendering should be realized.
  */
 public function render_component($params)
 {
     // Merge request and user parameters
     $_GET = array_merge($_GET, $params);
     // If a controller is not set, use current controller
     if (!isset($params['controller'])) {
         $controller_name = $this->name;
     } else {
         // Use the value stored in params as controller name
         $controller_name = basename($params['controller']);
         // Include the controller class file
         require_once dirname(__FILE__) . '/../controllers/' . $controller_name . '_controller.php';
         // Load localization table
         Localization::add_strings_table($controller_name);
     }
     // Create class name
     $classname = joined_lower_to_camel_case($controller_name) . 'Controller';
     // Instantiate controller
     $controller = new $classname();
     // Unset controller key from params (why?)
     unset($params['controller']);
     // Set requested action
     if (isset($params['action'])) {
         $action = basename($params['action']);
         $controller->action = $action;
     }
     // Invoke action method
     $controller->{$action}();
     // Request rendering with no layout
     $params['layout'] = FALSE;
     // Note that this could already have been called
     $controller->render($params);
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:44,代码来源:base_controller.php


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