Ejemplo n.º 1
0
include PATH_TO_APP . "views/_header.php";
?>

<h3>Products Catalog</h3>

<?php 
$categoriesArray = array();
foreach ($model->categories as $category) {
    array_push($categoriesArray, array("value" => $category, "content" => ucfirst($category)));
}
htmlRender::beginForm(array("action" => "home/filterProductsByCategory", "method" => "POST"));
htmlRender::DropDown(array("name" => "category"), $categoriesArray);
?>
&nbsp;<input type="submit" value="Filter" class="btn btn-default"><br>
<?php 
htmlRender::checkBox(array("name" => "getOnlyAvailable"));
?>
 <label>Available only</label>
<?php 
htmlRender::endForm();
?>

<br>
<br>

<?php 
htmlRender::beginForm(array("action" => "cart/addToCart", "method" => "POST"));
?>
<table class="table">
    <tr>
        <th>Name</th>
?>
Male<br>
<?php 
htmlRender::radioButton(array("name" => "sex", "value" => "female"));
?>
Female<br>
<br>

<!-- CheckBoxes -->
<br>
<?php 
htmlRender::checkBox(array("name" => "vehicle", "value" => "Bike"));
?>
I have a bike<br>
<?php 
htmlRender::checkBox(array("name" => "vehicle", "value" => "Car"));
?>
I have a car<br>
<br>

<!-- DropDown -->
<br>
Select Car: <?php 
htmlRender::DropDown(array("class" => "testClass"), array(array("value" => "volvo", "content" => "Volvo"), array("value" => "volvo", "content" => "Saab"), array("value" => "mercedes", "content" => "Mercedes"), array("value" => "audi", "content" => "Audi", "selected" => "selected")));
?>
<br>

<!-- TextField -->
<br>
Name: <?php 
htmlRender::textField(array("name" => "age", "class" => "testClass", "id" => "testId"));