route helpers pass() slim framework


pass()
Ketika metode ini dipanggil, Slim Segera berhenti memproses
 rute yang cocok saat ini dan meminta pencocokan 
berikutnya.jika tidak ada rute yang cocok ditemukan,
 respon 404 (Tidak Ditemukan) dikirim ke klien

$app = new \Slim\Slim();
$app->get('/hello/Frank', function () use ($app) {
    echo "You won't see this...";
    $app->pass();
});
$app->get('/hello/:name', function ($name) use ($app) {
    echo "But you will see this!";
});
$app->run();

untuk memanggil ketik url/hello/Frank

tampilan

pass_slim

keterangan
pass akan mencari /hello/Frank terlebih dahulu, baru mencari /hello/:name

tinggalkan pesan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d blogger menyukai ini: