/**
  * When /^I convert it to Kelvin$/
  **/
 public function stepIConvertItToKelvin()
 {
     $this->aGlobals['kelvin'] = kelvinate($this->aGlobals['centigrade']);
 }
Ejemplo n.º 2
0
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Kelvinator</title>
  </head>
  
  <body>
    <h1>Kelvinator</h1>
<?php 
if (array_key_exists("centigrade", $_GET)) {
    require "kelvinator.php";
    $centigrade = $_GET["centigrade"];
    $kelvin = kelvinate($centigrade);
    ?>
    <p><?php 
    echo $centigrade;
    ?>
 °C is <span id="kelvin"><?php 
    echo $kelvin;
    ?>
 °K</span></p>
<?php 
} else {
    ?>
    <form action="index.php" method="GET">
      <input name="centigrade" type="text">
      <label for="centigrade">°C</label>
      <input type="submit" value="Kelvinate!">
    </form>
<?php