CyberDuck\LinkItemField\Forms\LinkItemField
LinkItemField
Link Item Form element class
- Author: <andrewm@cyber-duck.co.uk>
- License: MIT License https://github.com/cyber-duck/silverstripe-linkitemfield/blob/master/LICENSE
Synopsis
class LinkItemField
extends FormField
{
- // members
- private static array $allowed_actions = ;
- protected array $fileCategories = ;
- protected array $imageCategories = ;
- // methods
- public void setFileCategories()
- public void setImageCategories()
- public boolean IsHidden()
- public int getLinkID()
- public string getLinkPath()
- public string LinkItemFormHTML()
- public Form LinkItemForm()
- public Form doSubmit()
- public string Field()
- private LinkItem getLinkObject()
- public boolean validate()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
private
- $allowed_actions
—
array
allowed_actions config
protected
- $fileCategories
—
array
Allowed file categories for File field - $imageCategories
—
array
Allowed image categories for Image field
Methods
private
- getLinkObject() — Internal helper method to return or create a LinkItem object
public
- Field() — Returns the rendered field object.
- IsHidden() — Hides the field. The actual form element is a hidden field.
- LinkItemForm() — Returns the modal Form object.
- LinkItemFormHTML() — Returns the LinkItemForm HTML for use in the AJAX request.
- doSubmit() — Returns the modal Form object.
- getLinkID() — Returns the relation ID for use in the template.
- getLinkPath() — Returns the LinkItem object Link for use in the template.
- setFileCategories() — Sets the allowed file categories
- setImageCategories() — Sets the allowed image categories
- validate() — Validate the field ID