示例#1
0
<?php

require '../vendor/autoload.php';
use EuMatheusGomes\Correios\CorreiosClient;
if (isset($_POST) && count($_POST) == 5) {
    $relaxation = new CorreiosClient('Relaxation');
    $relaxation->setRelaxation($_POST['relaxation'])->setTipoCep($_POST['TipoCep'])->setSemelhante($_POST['semelhante'])->setStartRow($_POST['start_row'])->setEndRow($_POST['end_row']);
    $data = $relaxation->requestData();
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Correios - Relaxation</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">

      <div class="panel panel-default">
        <div class="panel-body">
          <form method="post">
            <div class="form-group">
              <label for="relaxation">Type any brazilian address (without number) or postal code:</label>
示例#2
0
<?php

require '../vendor/autoload.php';
use EuMatheusGomes\Correios\CorreiosClient;
if (isset($_POST['cep']) && $_POST['cep'] != '') {
    $cep = new CorreiosClient('Cep');
    $cep->setCEP($_POST['cep']);
    $data = $cep->requestData();
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Correios - CEP</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">

      <div class="panel panel-default">
        <div class="panel-body">
          <form method="post">
            <div class="form-group">
              <label for="cep">Type a brazilian postal code</label>