本文整理匯總了PHP中Reference::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reference::setName方法的具體用法?PHP Reference::setName怎麽用?PHP Reference::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Reference
的用法示例。
在下文中一共展示了Reference::setName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$app->render(200, array('reference' => $referenceInfo));
});
$app->get('/:id', function ($id) use($app) {
$reference = new Reference($id);
$download = $app->request()->params('download');
if (null != $download && $download) {
header("Content-Disposition: attachment; filename=\"reference-{$id}.json\"");
}
$app->render(200, $reference->GetResults($app->request()->params('filters'), $app->request()->params('pageIndex'), $app->request()->params('pageSize')));
})->name('references');
$app->post('/:id', function ($id) use($app) {
$reference = new Reference($id);
$result = json_decode($app->request->getBody(), true);
if (false != $result) {
if (array_key_exists('name', $result)) {
$index = $reference->setName($result['name']);
$app->render(200, array());
}
} else {
$app->render(400, array('error' => true, 'msg' => 'Not JSON'));
}
});
$app->delete('/:id', function ($id) use($app) {
$reference = new Reference($id);
$reference->delete();
Notify(ADMIN_TOPIC, array('action' => 'delete', 'reference' => $id));
$app->render(200, array());
});
});
$app->group('/reports', function () use($app) {
$app->post('/', function () use($app) {
示例2: testBasicInvocation
public function testBasicInvocation()
{
$this->object->setName('test.param');
$this->assertEquals('parameterValue', $this->object->invoke($this->getContainer()));
}