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
TextArea
The TextArea control provides a box of limitless size allowing the user to enter large bodies of text.
It has no special attributes or behaviours.
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\TextArea;
use Rhubarb\Leaf\Leaves\Leaf;
class TextArea extends Leaf
{
/**
* @var TextAreaModel
*/
protected $model;
protected function getViewClass()
{
return TextAreaView::class;
}
protected function createModel()
{
return new TextAreaModel();
}
}
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\TextArea;
use Rhubarb\Leaf\Leaves\LeafModel;
class TextAreaModel extends LeafModel
{
public $description;
}
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\TextArea;
use Rhubarb\Leaf\Controls\Common\Text\TextArea;
use Rhubarb\Leaf\Views\View;
class TextAreaView extends View
{
/**
* @var TextAreaModel
*/
protected $model;
protected function createSubLeaves()
{
$this->registerSubLeaf(
$description = new TextArea("description")
);
$description->setPlaceholderText("Enter a description");
}
protected function printViewContent()
{
print $this->leaves["description"];
}
}