Multiple views in controller
Permalink
Hi!
I have a controller file in application/controllers/folder/payment.php and a view file in applications/views/folder/payment.php
in app.php i have declared the following:
payment.php controller:
payment.php view:
I now want to extend my controller to use another view as well. How do I do that?
I've tried to add a function named 'other' in controller and then in app.php add:
[code]Route::register('/folder/payment/other', '\Application\Controller\Folder\Payment::other');[code]
But this still render what is at $viewPath. Is it possible to redeclare this?
Thanks!
I have a controller file in application/controllers/folder/payment.php and a view file in applications/views/folder/payment.php
in app.php i have declared the following:
Route::register('/folder/payment', '\Application\Controller\Folder\Payment::view');
payment.php controller:
<?php namespace Application\Controller\Folder; use Controller; class Payment extends Controller { protected $viewPath = 'folder/payment'; public function on_start() { } public function view() { /** view code */ $this->set('param', 'value'); } }
Viewing 15 lines of 16 lines. View entire code block.
payment.php view:
I now want to extend my controller to use another view as well. How do I do that?
I've tried to add a function named 'other' in controller and then in app.php add:
[code]Route::register('/folder/payment/other', '\Application\Controller\Folder\Payment::other');[code]
But this still render what is at $viewPath. Is it possible to redeclare this?
Thanks!