Skip to content

Bagaimana Cara Membuat Custom Route? #269

Discussion options

You must be logged in to vote

Mas salah memahami cara kerja argumen ke dua dari fungsi trim(). Kalau mau spesifik ke deretan string tertentu, harusnya pakai substr():

$suffix = '/trending';
if ($path && str_ends_with($path, $suffix)) {
    $path = substr($path, 0, -strlen($suffix));
}

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@yuliakbard
Comment options

@taufik-nurrohman
Comment options

@yuliakbard
Comment options

@taufik-nurrohman
Comment options

Answer selected by taufik-nurrohman
@yuliakbard
Comment options

Comment options

You must be logged in to vote
1 reply
@taufik-nurrohman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
x.route Route extension.
2 participants