예제 #1
0
 public function get(Request $request)
 {
     $zip = $request->get('zip', '0');
     if ($zip !== '0' && mb_strlen($zip) === 8 && preg_match("/^[0-9]{8}?\$/", $zip)) {
         $zipcodeinfo = zipcode($zip);
         if ($zipcodeinfo) {
             return $zipcodeinfo->getJson();
         }
     }
     return Response::json(['error' => 1]);
 }
예제 #2
0
 /**
  * Test Helper
  */
 public function testHelperToZipCodeInfoInstance()
 {
     $this->assertInstanceOf('Canducci\\ZipCode\\Contracts\\ZipCodeInfoContract', zipcode('01414000'));
 }
예제 #3
0
 /**
  * Traits ZipCode
  *
  * @param string $value
  * @param bool $renew
  * @return Canducci\ZipCode\ZipCodeInfo
  * @throws Canducci\ZipCode\ZipCodeException
  */
 public function zipcode($value, $renew = false)
 {
     return zipcode($value, $renew);
 }
예제 #4
0
          title : "Property Details",
          url : "<?php 
the_permalink();
?>
",
          idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM,
          activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM
          }		
    new GSmapSearchControl(
          document.getElementById("mapsearch"),
          "<?php 
the_title();
?>
, <?php 
city();
?>
, <?php 
state();
?>
, <?php 
zipcode();
?>
",
          options
          );
    }
    GSearch.setOnLoadCallback(LoadMapSearchControl);
</script>
<div id="location" class="right">
    <div id="mapsearch">Loading...</div>
</div>