public function getFileUrl($entity, $field, $fileName = null)
    {
        if (func_num_args() < 3) {
            if ($entity) {
                $fileName = PropertyHelper::getValue($entity, $field);
            }
        }

        if ($fileName instanceof File) {
            $fileName = $fileName->getBasename();
        }

        if ($fileName) {
            return ltrim($this->httpRoot . '/' . $this->getRelativePath($entity, $field) . '/' . $fileName, '/');
        }

        return null;
    }
public function getFileUrl($entity, $field, $fileName = null)
    {
        if (func_num_args() < 3) {
            if ($entity) {
                $fileName = PropertyHelper::getValue($entity, $field);
            }
        }

        if ($fileName instanceof File) {
            $fileName = $fileName->getBasename();
        }

        if ($fileName) {
            return ltrim($this->httpRoot . '/' . $this->getRelativePath($entity, $field) . '/' . $fileName, '/');
        }

        return null;
    }
public function getFileUrl ( $ entity , $ field , $ fileName = null ) { if ( func_num_args ( ) < 3 ) { if ( $ entity ) { $ fileName = PropertyHelper :: getValue ( $ entity , $ field ) ; } } if ( $ fileName instanceof File ) { $ fileName = $ fileName -> getBasename ( ) ; } if ( $ fileName ) { return ltrim ( $ this -> httpRoot . '/' . $ this -> getRelativePath ( $ entity , $ field ) . '/' . $ fileName , '/' ) ; } return null ; }
Return the url to the file.

@param mixed $entity
@param string $field
@param mixed $fileName
@return null|string
Return the url to the file .