Class AdminPageFramework_Widget_Controller
Provides methods of views for the widget factory class.
Those methods are public and provides means for users to set property values.
Abstract
Package: AdminPageFramework\Factory\Widget
Since: 3.2.0
Located at factory/widget/AdminPageFramework_Widget_Controller.php
Package: AdminPageFramework\Factory\Widget
Since: 3.2.0
Located at factory/widget/AdminPageFramework_Widget_Controller.php
Methods summary
public
|
#
setUp( )
The method for necessary set-ups. Examplepublic function setUp() { $this->setArguments( array( 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), ) ); } Since
3.2.0
Overrides |
public
|
#
load( )
The method for setting up form elements. Examplepublic function load( $oAdminWidget ) { $this->addSettingFields( array( 'field_id' => 'title', 'type' => 'text', 'title' => __( 'Title', 'admin-page-framework-demo' ), 'default' => 'Hi there!', ), array( 'field_id' => 'repeatable_text', 'type' => 'text', 'title' => __( 'Text Repeatable', 'admin-page-framework-demo' ), 'repeatable' => true, 'sortable' => true, ), array( 'field_id' => 'textarea', 'type' => 'textarea', 'title' => __( 'Text Area', 'admin-page-framework-demo' ), ), array( 'field_id' => 'checkbox', 'type' => 'checkbox', 'title' => __( 'Check Box', 'admin-page-framework-demo' ), 'label' => __( 'This is a check box in a widget form.', 'admin-page-framework-demo' ), ), array( 'field_id' => 'radio', 'type' => 'radio', 'title' => __( 'Radio Buttons', 'admin-page-framework-demo' ), 'label' => array( 'one' => __( 'One', 'admin-page-framework-demo' ), 'two' => __( 'Two', 'admin-page-framework-demo' ), 'three' => __( 'Three', 'admin-page-framework-demo' ), ), 'default' => 'two', ), array( 'field_id' => 'select', 'type' => 'select', 'title' => __( 'Dropdown', 'admin-page-framework-demo' ), 'label' => array( 'i' => __( 'I', 'admin-page-framework-demo' ), 'ii' => __( 'II', 'admin-page-framework-demo' ), 'iii' => __( 'III', 'admin-page-framework-demo' ), ), ), array( 'field_id' => 'image', 'type' => 'image', 'title' => __( 'Image', 'admin-page-framework-demo' ), ), array( 'field_id' => 'media', 'type' => 'media', 'title' => __( 'Media', 'admin-page-framework-demo' ), ), array( 'field_id' => 'color', 'type' => 'color', 'title' => __( 'Color', 'admin-page-framework-demo' ), ), array() ); } Since
3.2.0
3.8.14 Deprecated the first parameter. Overrides |
protected
|
#
setArguments( array $aArguments = array() )
Sets the widget arguments. This is only necessary if it is not set in the constructor. Parameters
Since
3.2.0
See |