PathFinder::addLocation PHP Méthode

addLocation() public méthode

You can subsequentially add more contents by calling: :php:meth:PathFinder_Location::defineContents.
public addLocation ( array $contents = [], mixed $old_contents = null ) : PathFinder_Location
$contents array
$old_contents mixed
Résultat PathFinder_Location
    public function addLocation($contents = array(), $old_contents = null)
    {
        if ($old_contents && @$this->app->compat_42) {
            return $this->base_location->addRelativeLocation($contents, $old_contents);
        }
        /** @type PathFinder_Location $loc */
        $loc = $this->add('PathFinder_Location');
        return $loc->defineContents($contents);
    }

Usage Example

Exemple #1
0
 /**
  * Add new location with additional resources.
  *
  * @param array $contents
  * @param mixed $obsolete
  *
  * @return PathFinder_Location
  */
 public function addLocation($contents, $obsolete = UNDEFINED)
 {
     if ($obsolete !== UNDEFINED) {
         throw $this->exception('Use a single argument for addLocation');
     }
     return $this->pathfinder->addLocation($contents);
 }