Rendering controller to a different view in CakePHP

后端 未结 7 1064
长发绾君心
长发绾君心 2021-02-01 16:10

Is there a way to render a controller to a different view then normal? I\'m trying to pass some data from the controller to a non-default view. Meaning my controller is called:<

相关标签:
7条回答
  • 2021-02-01 17:06
    class StocksRealtimeController extends AppController {
    var $uses               = 'StockRealtime';
    
        function index(){
    
           $this->layout = NULL;
           $this->autoRender = false;
    
           $this->set('stocksRT', $this->StockRealtime->find('all'));
    
           $this -> render(`/TestView/index`);
    
        }
    }
    
    0 讨论(0)
提交回复
热议问题