本文整理匯總了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();
}
示例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;
}
示例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;
}
}
示例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));
}
示例5: getURI
public function getURI()
{
return $this->server->get('REQUEST_URI', '/');
}