當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Foo::setBar方法代碼示例

本文整理匯總了PHP中Foo::setBar方法的典型用法代碼示例。如果您正苦於以下問題:PHP Foo::setBar方法的具體用法?PHP Foo::setBar怎麽用?PHP Foo::setBar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Foo的用法示例。


在下文中一共展示了Foo::setBar方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 /**
  * Returns a collection of Foo instances according to
  * the configuration section.
  */
 public function &process(__ConfigurationSection &$section)
 {
     $return_value = array();
     $foobars = $section->getSections();
     foreach ($foobars as &$foobar) {
         $foo = new Foo();
         $foo->setBar($foobar->getAttribute('bar'));
         $return_value[] = $foo;
     }
     return $return_value;
 }
開發者ID:laiello,項目名稱:lion-framework,代碼行數:15,代碼來源:SectionHandler.class.php

示例2: getFooWithInlineService

 /**
  * Gets the 'foo_with_inline' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Foo A Foo instance.
  */
 protected function getFooWithInlineService()
 {
     $this->services['foo_with_inline'] = $instance = new \Foo();
     $instance->setBar($this->get('inlined'));
     return $instance;
 }
開發者ID:vomasmic,項目名稱:symfony,代碼行數:14,代碼來源:services9.php

示例3: getFooWithInlineService

 /**
  * Gets the 'foo_with_inline' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Foo A Foo instance
  */
 protected function getFooWithInlineService()
 {
     $a = new \Bar();
     $this->services['foo_with_inline'] = $instance = new \Foo();
     $a->setBaz($this->get('baz'));
     $a->pub = 'pub';
     $instance->setBar($a);
     return $instance;
 }
開發者ID:xing393939,項目名稱:Laravel-5-Bootstrap-3-Starter-Site,代碼行數:17,代碼來源:services9_compiled.php

示例4: getFooWithInlineService

 /**
  * Gets the 'foo_with_inline' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Foo A Foo instance
  */
 protected function getFooWithInlineService()
 {
     $this->services['foo_with_inline'] = $instance = new \Foo();
     $instance->setBar(${($_ = isset($this->services['inlined']) ? $this->services['inlined'] : $this->getInlinedService()) && false ?: '_'});
     return $instance;
 }
開發者ID:Gladhon,項目名稱:symfony,代碼行數:14,代碼來源:services9.php

示例5: Foo

<?php

require_once 'pb_proto_foo.php';
$foo = new Foo();
$foo->setBar(1);
$foo->setBaz('two');
$foo->appendSpam(3.0);
$foo->appendSpam(4.0);
$packed = $foo->serializeToString();
$foo->reset();
try {
    $foo->parseFromString($packed);
} catch (Exception $ex) {
    die('Upss.. there is a bug in this example');
}
$foo->dump();
開發者ID:fabiand93,項目名稱:php-protobuf,代碼行數:16,代碼來源:example.php


注:本文中的Foo::setBar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。