0

How can i retrieve absolute path of view and layout file in cakephp action. I cant find useful method or property in

// in action
var_dump($this);

Thank

desire out put is

/home/sweb/www/cakeapp/app/View/Layout/mylayout.ctp
/home/sweb/www/cakeapp/app/View/Mycntl/myaction.ctp

1 Answers1

1

I would use this to create a full path.

APP . 'View' . DS . 'Layout' . DS . $this->layout

Which will output something like this for you,

string '/Users/david/Sites/ExampleSite/app/View/Layout/default' (length=56)

In order to get the view, I'd use

APP . 'View' . DS . $this->modelClass . DS . $this->view
David Yell
  • 11,756
  • 13
  • 61
  • 100