Edit Single Page with Multiple Views
Permalink
Hello,
I have a single page with 2 different views. One view.php and another video.php.
My controller separates uses a view($action = false) to decide which view to render. If $action=false, then it renders view.php, if $action isn't false it renders video.php.
So, the URL looks like this:
/elearning/students/ (loads view.php and is a registered single page)
/elearning/students/Module1 (loads video.php and uses Module1 in the controller code)
My issue is that when I click edit from /elearning/students/Module1, it takes me to /elearning/students in edit mode. I have some editable areas inside my video.php and would like to edit them inline.
How can I accomplish this?
Below is my code:
/controllers/elearning/students.php
Maybe the issue is with $this->render()?
Thanks in advance for your help!
I have a single page with 2 different views. One view.php and another video.php.
My controller separates uses a view($action = false) to decide which view to render. If $action=false, then it renders view.php, if $action isn't false it renders video.php.
So, the URL looks like this:
/elearning/students/ (loads view.php and is a registered single page)
/elearning/students/Module1 (loads video.php and uses Module1 in the controller code)
My issue is that when I click edit from /elearning/students/Module1, it takes me to /elearning/students in edit mode. I have some editable areas inside my video.php and would like to edit them inline.
How can I accomplish this?
Below is my code:
/controllers/elearning/students.php
public function on_start() { } public function edit() { } public function view($action = FALSE) { if($action == NULL) { /* Code Here */ $this->render('/elearning/students/'); } else { /* Code Here */ $this->render('/elearning/students/video'); } } }
Maybe the issue is with $this->render()?
Thanks in advance for your help!