ブログスレッド

  • CakePHP3: Get the full URL of the current page

CakePHP3: Get the full URL of the current page

Method 1: Use the URL helper


$url = $this->Url->build([
"controller" => "Posts",
"action" => "search",
"?" => ["foo" => "bar"]
],true);


Method 2: Use the Router


use Cake\Routing\Router;

$url = Router::url([
'controller' => 'Posts',
'action' => 'search',
'?' => ['foo' => $bar]
], true);
#cakephp3

ワオ!と言っているユーザー

×
  • ブログルメンバーの方は下記のページからログインをお願いいたします。
    ログイン
  • まだブログルのメンバーでない方は下記のページから登録をお願いいたします。
    新規ユーザー登録へ