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


PHP self::set方法代码示例

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


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

示例1: fromLocaleString

 public static function fromLocaleString($localeString)
 {
     $locale = new self();
     preg_match('/([a-z]{2})(-([a-zA-Z]{2}))*/i', $localeString, $matches);
     if (array_key_exists(1, $matches)) {
         $locale->set('language', strtolower($matches[1]));
     }
     if (array_key_exists(3, $matches)) {
         $locale->set('country', strtolower($matches[3]));
     }
     return $locale;
 }
开发者ID:jenalgit,项目名称:atsumi,代码行数:12,代码来源:mvc_LocaleModel.php

示例2: loadTemplate

 public function loadTemplate($templateName, $vars = array())
 {
     $class = new self();
     $class->viewname = $this->viewname;
     $class->set($vars);
     return $class->output($templateName);
 }
开发者ID:jasonrey,项目名称:project-test-report,代码行数:7,代码来源:view.php

示例3: render

 /**
  * (non-PHPdoc)
  * @see Simplify_ViewInterface::render()
  */
 public function render(\Simplify\RenderableInterface $object = null)
 {
     if (empty($object)) {
         $object = $this->object;
     }
     $template = $object->getTemplate();
     if ($template === false) {
         return '';
     }
     \Simplify::response()->header('Content-Type: text/html; charset=UTF-8');
     $output = $this->internalRender($object, $template);
     $layout = $object->getLayout();
     if ($layout !== false) {
         if (empty($layout)) {
             $layout = $this->getLayout();
         }
         $view = new self();
         $view->copyAll($object);
         $view->copyAll($this);
         $view->set('layout_content', $output);
         $view->setTemplate($layout);
         $view->setTemplatesPath($object->getLayoutsPath());
         $view->setLayout(false);
         $output = $view->render();
     }
     return $output;
 }
开发者ID:rutkoski,项目名称:simplify,代码行数:31,代码来源:Twig.php

示例4: newFromReport

 static function newFromReport($oReport, $iGroupId = 0)
 {
     $obj = new self();
     $obj->set($oReport);
     $obj->groupId = (int) $iGroupId;
     return $obj;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:7,代码来源:SDOutputChart.class.php

示例5: getInstanceByRow

	/**
	 * Function to get instance of this model
	 * @param <Array> $rowData
	 * @return <Settings_SysVars_Field_Model> field model
	 */
	public static function getInstanceByRow($rowData) {
		$fieldModel = new self();
		foreach ($rowData as $key => $value) {
			$fieldModel->set($key, $value);
		}
		return $fieldModel;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:12,代码来源:Field.php

示例6: quick

 /**
  * Render content quickly
  *
  * @param  string $root
  * @param  string $template
  * @param  array  $env
  * @return string
  */
 public static function quick($root, $template, array $env = array())
 {
     $T = new self($root);
     $T->set($env);
     ob_start();
     $T->display($template);
     return ob_get_clean();
 }
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:16,代码来源:micro_template.class.php

示例7: create

 /**
  * Ajoute un champ dans la configuration du formulaire
  *
  * @param string $varName Nom du champs à ajouter
  *
  * @return self
  */
 public function create($varName)
 {
     $elmt = new self();
     $elmt->set('', 'test')->set(false, 'obligatoire');
     $this->set($elmt, $varName);
     $this->varName = $varName;
     return $this;
 }
开发者ID:solire,项目名称:form,代码行数:15,代码来源:FastConfig.php

示例8: fromArray

 /**
  * Function to get Field instance from array
  * @return <Settings_MappedFields_Field_Model>
  */
 public static function fromArray($row = [])
 {
     $instance = new self();
     foreach ($row as $name => $value) {
         $instance->set($name, $value);
     }
     return $instance;
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:12,代码来源:Field.php

示例9: generate

 /**
  * Generate a view and return it
  * 
  * @param string $view
  * @param array $config
  * @param array $data
  * 
  * @return \self
  */
 public static function generate($view = null, $config = null, $data = array())
 {
     $v = new self($view, $config);
     if (!empty($data)) {
         $v->set($data);
     }
     return $v;
 }
开发者ID:antoniocs,项目名称:view,代码行数:17,代码来源:View.php

示例10: fromObject

 /**
  * @param object $projection
  *
  * @return \Cubiche\Core\Projection\DefaultProjectionBuilder
  */
 public static function fromObject($projection)
 {
     $builder = new self();
     foreach (self::projectionProperties($projection) as $property => $value) {
         $builder->set($property, $value);
     }
     return $builder;
 }
开发者ID:cubiche,项目名称:cubiche,代码行数:13,代码来源:DefaultProjectionBuilder.php

示例11: create_from_array

 public static function create_from_array($menu_items)
 {
     $items_comp = new self();
     foreach ($menu_items as $slug => $menu_item) {
         $menu_item['slug'] = $slug;
         $items_comp->set($slug, self::create_menu_item($menu_item));
     }
     return $items_comp;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:9,代码来源:class-options-menu-items-composition.php

示例12: create

 public static function create($data)
 {
     $manager = new self();
     $manager->setDefaultDirectories(new Directories('default', $data['directories'], $manager));
     foreach ($data['servers'] as $name => $server) {
         $manager->set(new Server($name, $server, $manager));
     }
     foreach ($data['sources'] as $name => $source) {
         $manager->set(Source::make($name, $source, $manager));
     }
     foreach ($data['environments'] as $name => $environment) {
         $manager->set(new Environment($name, $environment, $manager));
     }
     foreach ($data['tasks'] as $name => $tasks) {
         $manager->set(new Tasks($name, $tasks, $manager));
     }
     return $manager;
 }
开发者ID:onigoetz,项目名称:deployer,代码行数:18,代码来源:ConfigurationManager.php

示例13: register

 public static function register($username, $name, $email, $admin, $password)
 {
     $id = DataFacade::register($username, $name, $email, $admin, $password);
     if ($id) {
         $u = new self();
         return $u->set('id', $id)->select();
     }
     return null;
 }
开发者ID:nyangara,项目名称:--ngara,代码行数:9,代码来源:Usuario.php

示例14: add

 public function add($link, $text, $name = null)
 {
     $nav = new self();
     $nav->set($link, $text);
     $this->_subnavigation[$name] = $nav;
     // Set member var
     if ($name) {
         $this->{$name} = $this->_subnavigation[$name];
     }
 }
开发者ID:derfl0,项目名称:QuickMVC,代码行数:10,代码来源:Navigation.php

示例15: fromTokenData

 public static function fromTokenData(array $data) : self
 {
     $instance = new self();
     $instance->data = [];
     foreach ($data as $key => $value) {
         $instance->set((string) $key, $value);
     }
     $instance->originalData = $instance->data;
     return $instance;
 }
开发者ID:Ocramius,项目名称:PSR7Session,代码行数:10,代码来源:DefaultSessionData.php


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