src/ScContent/Service/Dir.php
public function appPublic($path = '', $checkIfExists = false)
    {
        $appPublicDir = getcwd() . $this->getRelativeAppPublicDir();
        if ($checkIfExists) {
            return realpath($appPublicDir . DS . $path);
        }
        if (empty($path)) {
            return $appPublicDir;
        }
        return $appPublicDir . DS . $this->normalizePath($path);
    }
public function appPublic($path = '', $checkIfExists = false)
    {
        $appPublicDir = getcwd() . $this->getRelativeAppPublicDir();
        if ($checkIfExists) {
            return realpath($appPublicDir . DS . $path);
        }
        if (empty($path)) {
            return $appPublicDir;
        }
        return $appPublicDir . DS . $this->normalizePath($path);
    }
public function appPublic ( $ path = '' , $ checkIfExists = false ) { $ appPublicDir = getcwd ( ) . $ this -> getRelativeAppPublicDir ( ) ; if ( $ checkIfExists ) { return realpath ( $ appPublicDir . DS . $ path ) ; } if ( empty ( $ path ) ) { return $ appPublicDir ; } return $ appPublicDir . DS . $ this -> normalizePath ( $ path ) ; }
Returns the path to the application public directory or any
child path.

If the flag "checkIfExists" is set to TRUE, checks for the specified
path and if the path was not found, returns FALSE.

Usage:
<code>
$dir = $serviceLocator->get('ScService.Dir');
$myAssetsDir = $dir->appPublic('/mydirectory');
$myCss = $dir->appPublic('/mydirectory/css/example.css');
</code>

@api

@param  string  $path
@param  boolean $checkIfExists optional default false
@return string
Returns the path to the application public directory or any child path .