Dashboard single page doesn't load with controller

Permalink
I'm building an image gallery with a dashboard interface to add new images. There is an edit section where the gallery's ID is passed to the controller and a single page is loaded so that you can change the name of the gallery and add a new image. This section works as expected, but I'd like to add another section that allows you to see all images in the gallery and remove/change them. I have a link to this new section like so:

<a href="<?php print $this->action('viewImages'); ?>">Manage Images for Gallery</a>


And the controller's method is this:

public function viewImages() {
      $this->set('test', 'test');
      $this->render('image');
   }


I've also added a new single page called "image" and registered it in the single pages section of the dashboard under /dashboard/gallery/edit/image. However, when I click on the link it goes to the outward facing site, as if it were a page in the regular site, not the dashboard. I thought the render() method would load a new single page, am I using it incorrectly?

And would it be better to design the interface to hit the controller's viewImage() method and just load in new content to the edit.php file? It seems like C5's MVC works half the time and the rest it does its own thing.

jyncka
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
While the action method is relative to the current page/controller, render requires the full path within the site, as you have set up the single page path for.
jyncka replied on at Permalink Reply
jyncka
Perfect! That saved me a lot of searching on google for an explanation. Thank you!