Simple back button navigation plugin

Hi, I am trying to do a simple back nav button in the panel, if the page has any parent page.
But getting the panel url sems to be a tricky thing to get.
So the basic is:

  1. If page has parent page
  2. Get the parent page panel url
  3. Display the icon/button

HELP !!

Now I am doing som crazy stuff like :

<?php echo panel()->urls()->index() .DS. 'pages' .DS. $field->page()->parent()->uri() .DS. 'edit' ?>

There’s the purl helper function, but it’s basically not very different from what your are doing manually, so you might as well leave it as is.