Getting wrong relative path from file id

Permalink
Hi

i trying getting a simple path image from my custom block

add.php/ edit.php
has a select for image

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $al = Loader::helper('concrete/asset_library');
?>
   <label><?php echo t('Image')?></label>
   <div class="input">   
      <?php echo $al->image('ccm-b-image', 'my_image', t('Choose Image'), null);?>
   </div>


on my controller i getting my file
with this in the view

public function view(){ 
         $imageFile = File::getByID($this->post('my_image'));
         $fv = $imageFile->getApprovedVersion(); 
         $relpath = $fv->getRelativePath();
         $this->set('image', $relpath); 
      }


this return in my view /files/

 

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.