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


PHP ArrayObject::get方法代碼示例

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


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

示例1: run

 public function run()
 {
     $route = $this->router->match($this->request);
     if ($route === false) {
         $actionName = self::ACTION_NOT_FOUND;
     } else {
         $actionName = $route->getName();
     }
     if (!$this->actions->has($actionName)) {
         throw new \Exception(sprintf('Action %s not found', $actionName));
     }
     $this->store->setFileName($actionName);
     if ($this->request->isAjax()) {
         $this->view->setRenderType(View::RENDER_JSON);
     } else {
         $this->view->setContentView('error');
     }
     $action = $this->actions->get($actionName);
     call_user_func_array($action, array($this));
     if (is_callable($this->postAction)) {
         call_user_func_array($this->postAction, array($this));
     }
     $this->response->setContent($this->view->render());
     $this->response->send();
 }
開發者ID:Acidburn0zzz,項目名稱:devtools-1,代碼行數:25,代碼來源:Application.php

示例2: toString

 /**
  * To String
  *
  * @return string
  */
 public final function toString()
 {
     $result = "";
     foreach ($this->values as $key => $value) {
         $value = $this->values->get($key);
         $result .= $key . ": " . $value . "\r\n";
     }
     // add cookies
     $result .= $this->getCookie();
     return $result;
 }
開發者ID:elgervb,項目名稱:php-http,代碼行數:16,代碼來源:HttpHeaders.php

示例3: get

 /**
  *
  * @return mixed
  */
 public function get()
 {
     if (method_exists($this->_field, 'get')) {
         $value = $this->_field->get($value);
     }
     $values = $this->_values();
     $name = $this->_field->name;
     if ($values->offsetExists($name)) {
         return $values[$name];
     } else {
         return $this->_field->default;
     }
 }
開發者ID:jerfowler,項目名稱:yada,代碼行數:17,代碼來源:core.php

示例4: testConstructor1

 public function testConstructor1()
 {
     $a = array('name', 'age');
     $b = new ArrayObject('name', 'age');
     $c = new ArrayObject($a);
     $d = new ArrayObject($b);
     $this->assertEquals('name', $a['0']);
     $this->assertEquals('name', $b['0']);
     $this->assertEquals('name', $c['0']);
     $this->assertEquals('name', $d['0']);
     $this->assertEquals('age', $a[1]);
     $this->assertEquals('age', $b[1]);
     $this->assertEquals('age', $c[1]);
     $this->assertEquals('age', $d[1]);
     $this->assertEquals('age', $b->get(1));
     $this->assertEquals('age', $c->get(1));
     $this->assertEquals('age', $d->get(1));
     $this->assertEquals('age', $b->get('1'));
     $this->assertEquals('age', $c->get('1'));
     $this->assertEquals('age', $d->get('1'));
     $this->assertEquals('name', $b->get(0));
     $this->assertEquals('name', $c->get(0));
     $this->assertEquals('name', $d->get(0));
 }
開發者ID:php-mod,項目名稱:php-lang,代碼行數:24,代碼來源:ArrayObjectTest.php

示例5: getURI

 public function getURI()
 {
     return $this->server->get('REQUEST_URI', '/');
 }
開發者ID:Acidburn0zzz,項目名稱:devtools-1,代碼行數:4,代碼來源:Request.php


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