【发布时间】:2016-03-05 06:38:04
【问题描述】:
嗨,我正在学习树枝,但我被卡住了。它不检查是否提交了表单,所以我猜是有什么不正确的。 谁能指出我正确的方法。
{% if method == 'POST' %}
Method posted
{% endif %}ˇ
我的get函数
$app->get('/p/:id', function ($id) use ($app) {
$pDItem = $app->pD->where('id', $id)->first();
if (!$pDItem) {
$app->notFound();
}
$app->render('pD/pDItem.php', [
'pDItem' => $pDItem,
'method' => $app->request->getMethod()
]);
})->name('pD.item');
-
【问题讨论】: