Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidvthecoder/3995142 to your computer and use it in GitHub Desktop.

Select an option

Save davidvthecoder/3995142 to your computer and use it in GitHub Desktop.

Revisions

  1. CURT Manufacturing revised this gist Aug 28, 2012. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions Happpi_getStyles.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $vehicle = new CurtVehicle(); // create new vehicle object to gain access to its functions.

    $vehicle->setMount("rear"); // set optional "dependency" of mount.
    $vehicle->setYear(2010); // set dependency of year.
    $vehicle->setMake("Ford"); // set dependency of make.
    $vehicle->setModel("F-150"); // set dependency of model.
    $styles = $vehicle->getStyles(); // call getStyles which returns a list of styles (strings)


    echo "<h2>The list of models for rear mount, 2010, Ford, F-150</h2>";
    foreach($styles as $style){ // step through the list of styles.
    echo $style;
    echo "<br />";
    }
    ?>
  2. CURT Manufacturing revised this gist Aug 28, 2012. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions Happpi_getModels.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $vehicle = new CurtVehicle(); // create new vehicle object to gain access to its functions.

    $vehicle->setMount("rear"); // set optional "dependency" of mount.
    $vehicle->setYear(2010); // set dependency of year.
    $vehicle->setMake("Ford"); // set dependency of make.
    $models = $vehicle->getModels(); // call getModels which returns an array of models (strings).

    echo "<h2>The list of models for rear mount, 2010, Ford</h2>";
    foreach($models as $model){ // step through the list of models.
    echo $model;
    echo "<br />";
    }
    ?>
  3. CURT Manufacturing revised this gist Aug 28, 2012. 2 changed files with 19 additions and 1 deletion.
    18 changes: 18 additions & 0 deletions Happpi_getMakes.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $vehicle = new CurtVehicle(); // create new vehicle object to gain access to its functions.

    $vehicle->setMount("rear"); // set optional "dependency" of mount.
    $vehicle->setYear(2010); // set dependency of year.
    $makes = $vehicle->getMakes(); // call getMakes which returns an array of makes (strings).

    echo "<h2>The list of makes for rear mount, 2010</h2>";
    foreach($makes as $make){ // step through the list of makes.
    echo $make;
    echo "<br />";
    }
    ?>
    2 changes: 1 addition & 1 deletion Happpi_getYears.php
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@
    $years = $vehicle->getYears(); // call getYears which returns an array of type float (for half years).

    echo "<h2>The list of years that has rear mounts</h2>";
    foreach($years as $year){ // step through the list of categories
    foreach($years as $year){ // step through the list of years
    echo $year;
    echo "<br />";
    }
  4. CURT Manufacturing revised this gist Aug 28, 2012. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions Happpi_getYears.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $vehicle = new CurtVehicle(); // create new vehicle object to gain access to its functions.

    $vehicle->setMount("rear"); // set optional "dependency" of mount.
    $years = $vehicle->getYears(); // call getYears which returns an array of type float (for half years).

    echo "<h2>The list of years that has rear mounts</h2>";
    foreach($years as $year){ // step through the list of categories
    echo $year;
    echo "<br />";
    }
    ?>
  5. CURT Manufacturing revised this gist Aug 28, 2012. 2 changed files with 16 additions and 0 deletions.
    File renamed without changes.
    16 changes: 16 additions & 0 deletions Happpi_getParentCategories.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $category = new CurtCategory(); // create new category object to use category's functions.

    $MainCategories = $category->getParentCategories(); // call getParentCategories which returns a list of categories.

    echo "<h2>Main Categories</h2>";
    foreach($MainCategories as $category){ // step through the list of categories
    echo $category->getCatTitle(); // print the title of each category.
    echo "<br />";
    }
    ?>
  6. CURT Manufacturing created this gist Aug 28, 2012.
    30 changes: 30 additions & 0 deletions GettingStarted.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    <?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

    ?>
    <!doctype html>
    <html>
    <head>

    </head>
    <body>
    <h1>Your PHP Website.</h1>

    <?php

    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $category = new CurtCategory(); // create new category object to use category's functions.

    $MainCategories = $category->getParentCategories(); // call getParentCategories which returns a list of categories.

    echo "<h2>Main Categories</h2>";
    foreach($MainCategories as $category){ // step through the list of categories
    echo $category->getCatTitle(); // print the title of each category.
    echo "<br />";
    }

    ?>
    </body>
    </html>