本文整理汇总了PHP中app\Item::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::getTitle方法的具体用法?PHP Item::getTitle怎么用?PHP Item::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Item
的用法示例。
在下文中一共展示了Item::getTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modification
/**
* @testdox An item can be created and modified.
*/
public function modification()
{
$item = new Item(null, $this->testUser);
$item->save(['title' => 'Test']);
$this->assertEquals(1, $item->getId());
$this->assertEquals('Test', $item->getTitle());
$this->assertEquals(1, $this->db->query("SELECT COUNT(*) FROM `items`")->fetchColumn());
$item->save(['id' => 1, 'title' => 'Testing Title']);
$this->assertEquals(1, $item->getId());
$this->assertEquals('Testing Title', $item->getTitle());
$this->assertEquals(1, $this->db->query("SELECT COUNT(*) FROM `items`")->fetchColumn());
}
示例2: render
public function render(Request $request, Response $response, array $args)
{
$item = new Item($args['id']);
$size = isset($args['size']) ? $args['size'] : 'o';
$version = isset($args['version']) ? $args['version'] : null;
$cacheFile = $item->getCachePath($size, $version);
$fileResponse = new BinaryFileResponse($cacheFile);
$fileResponse->headers->set('Content-Type', 'image/png');
$fileResponse->setFile($cacheFile);
$fileResponse->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE, $item->getTitle() . '.png');
return $fileResponse;
}
示例3: view
public function view(Request $request, Response $response, array $args)
{
$item = new Item($args['id'], $this->user);
$template = new \App\Template('view.twig');
$template->item = $item;
$template->title = $item->getTitle();
$template->tags = $item->getTags();
$template->mime_type = $item->getMimeType();
$template->itemReadGroup = $item->getReadGroup();
$template->itemEditGroup = $item->getEditGroup();
// Return the template.
$response->setContent($template->render());
return $response;
}