Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • AjaxUniqueTextField
  • AutocompleteTextField
  • ConfirmedPasswordField
  • CreditCardField
  • CurrencyField
  • CurrencyField_Disabled
  • CurrencyField_Readonly
  • EmailField
  • HtmlEditorConfig
  • HtmlEditorField
  • HtmlEditorField_Readonly
  • HtmlEditorField_Toolbar
  • NumericField
  • PasswordField
  • PhoneNumberField
  • UniqueRestrictedTextField
  • UniqueTextField
 1 <?php
 2 /**
 3  * Password input field.
 4  * @package forms
 5  * @subpackage fields-formattedinput
 6  */
 7 class PasswordField extends FormField {
 8 
 9     /**
10      * maxlength of the password field
11      *
12      * @var int
13      */
14     protected $maxLength;
15 
16 
17     /**
18      * Returns an input field, class="text" and type="text" with an optional
19      * maxlength
20      */
21     function __construct($name, $title = null, $value = "", $maxLength = null) {
22         $this->maxLength = $maxLength;
23         parent::__construct($name, $title, $value);
24     }
25 
26 
27     function Field() {
28         $attributes = array(
29             'class' => 'text',
30             'type' => 'password',
31             'id' => $this->id(),
32             'name' => $this->name,
33             'value' => $this->attrValue(),          
34         );              
35         if (count($this->extraAttributes)) {
36             $attributes = array_merge($attributes, $this->extraAttributes);
37         }
38         return $this->createTag('input', $attributes);
39     }
40 
41 
42     /**
43      * Makes a pretty readonly field with some stars in it
44      */
45     function performReadonlyTransformation() {
46         $stars = '*****';
47 
48         $field = new ReadonlyField($this->name, $this->title ? $this->title : '', $stars);
49         $field->setForm($this->form);
50         $field->setReadonly(true);
51         return $field;
52     }
53 }
54 
55 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0