當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。