I want to rewrite JSON View in the RequestHandler. So there's a file project_root/lib/JsonView.php
. What I want to do is to
- Import the
JsonView.php
file in another file inproject_root/app/View/CustomJsonView.php
. (I think I could useApp:import
, would it be right ?) - Choose this file as the custom in requestHandler like this:
public $components = array('RequestHandler' => array( 'viewClassMap' => array('json' => '/right/way/to/this/file/CustomJsonView', )));
But how do I write the right way for this file ? I also saw this one https://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html#RequestHandlerComponent::viewClassMap but there is no explanation about the right paths to the file. My CakePHP version is 2.4.4 .