示例#1
0
文件: Dialect.php 项目: nabble/ajde
 /**
  * @param string $html
  *
  * @return mixed
  */
 public static function inlineCss($html)
 {
     $url = 'http://premailer.dialect.ca/api/0.1/documents';
     $data = ['html' => $html, 'preserve_styles' => 'false'];
     $json = Ajde_Http_Curl::post($url, $data);
     $result = @json_decode($json);
     if (is_object($result) && isset($result->documents)) {
         $url = $result->documents->html;
         return Ajde_Http_Curl::get($url);
     }
     return $html;
 }
示例#2
0
文件: Torchbox.php 项目: nabble/ajde
 /**
  * @param string $html
  *
  * @return mixed
  */
 public static function inlineCss($html)
 {
     $url = 'https://inlinestyler.torchbox.com:443/styler/convert/';
     $data = ['returnraw' => '1', 'source' => $html];
     return Ajde_Http_Curl::post($url, $data);
 }