Airship\Cabin\Bridge\Blueprint\Skyport::getURL PHP Method

getURL() public method

public getURL ( string $type, string $supplier, string $name ) : string
$type string
$supplier string
$name string
return string
    public function getURL(string $type, string $supplier, string $name) : string
    {
        switch (\strtolower($type)) {
            case 'cabin':
                return $this->prefix . 'cabin/' . $supplier . '/' . $name;
            case 'gadget':
                return $this->prefix . 'gadget/' . $supplier . '/' . $name;
            case 'motif':
                return $this->prefix . 'motif/' . $supplier . '/' . $name;
            default:
                return $this->prefix;
        }
    }

Usage Example

Example #1
0
 /**
  * @route ajax/admin/skyport/view
  */
 public function ajaxViewPackageInfo()
 {
     $expected = ['package', 'supplier', 'type'];
     if (!\Airship\all_keys_exist($expected, $_POST)) {
         echo 'Invalid POST request.', "\n";
         return;
     }
     $this->lens('skyport/view', ['package' => $this->skyport->getDetails($_POST['type'], $_POST['supplier'], $_POST['package']), 'skyport_url' => $this->skyport->getURL($_POST['type'], $_POST['supplier'], $_POST['package'])]);
 }