Infusionsoft_WebFormService::getHTML PHP Метод

getHTML() публичный статический Метод

Get the full HTML for the specified web form ID. This includes all HTML tags and is meant to be used as a standalone webpage.
public static getHTML ( integer $webFormId, Infusionsoft_App $app = null ) : string
$webFormId integer The ID from Infusionsoft_WebFormService::getMap.
$app Infusionsoft_App
Результат string Full HTML for the web form.
    public static function getHTML($webFormId, Infusionsoft_App $app = null)
    {
        $app = parent::getObjectOrDefaultAppIfNull($app);
        return $app->send("WebFormService.getHTML", array($webFormId));
    }

Usage Example

 /**
  * Get the web form's hosted URL.
  *
  * Instead of having to use the HTML code, you can get the URL to the 
  * Infusionsoft hosted version of the web form.
  *
  * @author Jacob Allred <*****@*****.**>
  *
  * @param int $webFormId The ID from Infusionsoft_WebFormService::getMap.
  * @param Infusionsoft_App $app
  * @return string URL of hosted web form
  */
 public static function getHostedURL($webFormId, Infusionsoft_App $app = null)
 {
     $app = parent::getObjectOrDefaultAppIfNull($app);
     /*
      * The API doesn't provide a method of getting the hosted URL.
      * Instead, we are going to get the HTML, find the form GUID, and create
      * the hosted URL on our own.
      */
     // Get the HTML
     $html = Infusionsoft_WebFormService::getHTML($webFormId, $app);
     // Create our search string
     $search = $app->getHostname() . '/app/form/process/';
     // Find the start and stop position of the form GUID
     $start = strpos($html, $search) + strlen($search);
     $stop = strpos(substr($html, $start), '"');
     // Pull out the GUID
     $guid = substr($html, $start, $stop);
     // Put together the hosted URL
     $url = 'https://';
     $url .= $app->getHostname();
     $url .= '/app/form/' . $guid;
     return $url;
 }
All Usage Examples Of Infusionsoft_WebFormService::getHTML