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
PasswordTextBox
PasswordTextBox
captures password text obscuring user input using the password HTML input element.
It extends TextBox and so includes all of it's properties and behaviours but adds no additional ones.
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\PasswordTextBox;
use Rhubarb\Leaf\Leaves\Leaf;
class PasswordTextBox extends Leaf
{
/**
* @var PasswordTextBoxModel
*/
protected $model;
protected function getViewClass()
{
return PasswordTextBoxView::class;
}
protected function createModel()
{
return new PasswordTextBoxModel();
}
}
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\PasswordTextBox;
use Rhubarb\Leaf\Leaves\LeafModel;
class PasswordTextBoxModel extends LeafModel
{
public $password;
}
<?php
namespace Rhubarb\Leaf\Controls\Common\Examples\Text\PasswordTextBox;
use Rhubarb\Leaf\Views\View;
use Rhubarb\Leaf\Controls\Common\Text\PasswordTextBox;
class PasswordTextBoxView extends View
{
/**
* @var PasswordTextBoxModel
*/
protected $model;
protected function createSubLeaves()
{
$this->registerSubLeaf(
$password = new PasswordTextBox("password")
);
$password->setMaxLength(15);
}
protected function printViewContent()
{
print $this->leaves["password"];
}
}