Contents
- Basic Concepts
- Introduction
- Processing user interactions
- Nesting leaves
- Data Binding
- Tutorial
- Building a blog
- View Bridges
- Introduction
- The model
- Re-rendering
- Events
- Handling Children
- Controls
- Extending View Bridges
- Control Components
- What is a control?
- Text Controls
- TextBox
- TextArea
- PasswordTextBox
- Selection Controls
- The selection control pattern
- Standard Variants
- DropDown
- CheckSet
- RadioButtons
- SearchControl
- ModelSearchControl
- Attaching additional data
- Dynamically driving the available items
- File Uploads
- SimpleFileUpload
- Html5FileUpload
- Other
- Buttons
- Building your own control
- Application Components
- What is an application component?
- Pager
- Table
- SearchPanel
- Tabs
- Advanced Topics
- View Indexes
RadioButtons
RadioButtons
presents items as a range of radio buttons.
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\SelectionControls;
use Rhubarb\Leaf\Controls\Common\SelectionControls\RadioButtons\RadioButtons;
use Rhubarb\Leaf\Views\View;
class RadioButtonsExampleView extends View
{
protected function createSubLeaves()
{
$this->registerSubLeaf(
$control = new RadioButtons("control")
);
$control->setSelectionItems(
[
"Item 1",
"Item 2",
[ 3, "Item 3"],
ExampleContact::all()->addSort("FirstName")
]
);
}
protected function printViewContent()
{
print $this->leaves["control"];
}
}