本文整理汇总了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', '/');
}