LoginSignup
0
0

More than 5 years have passed since last update.

CakePHP2.x系でviewにてURLとかを見たい場合

Posted at

久しぶりにCakePHP2系を触っていて、View側で今のURL見て何かやりたいときに
どうするか思い出せなかったのでメモる

基本的には$this->requestを見る。

// URL
echo $this->request->url;

でもまあアクションとかみたいて判断したいことのが多い気がする

よくつかいそうなやつだけメモっておく

// 現在のコントローラ
$this->request->params["controller"]

// 現在のアクション
$this->request->params["action"]

// ページングの時のパラメータはいってるやつ
$this->request->named

おわり

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0