在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:michaeluno/admin-page-framework开源软件地址:https://github.com/michaeluno/admin-page-framework开源编程语言:PHP 81.3%开源软件介绍:Admin Page FrameworkWelcome to Admin Page Framework GitHub RepositoryAdmin Page Framework is an OOP based open source WordPress library that facilitates theme and plugin development. InstallationThere are mainly two ways to include the framework.
For more details, see the Getting Started ( ExamplesCreate a Page<?php
/* Plugin Name: Admin Page Framework - Getting Started */
include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.php' );
class APF extends AdminPageFramework {
public function setUp() {
$this->setRootMenuPage( 'Settings' ); // where to belong
$this->addSubMenuItem(
array(
'title' => 'My First Page',
'page_slug' => 'myfirstpage'
)
);
}
/**
* @callback action do_{page slug}
*/
public function do_myfirstpage() {
?>
<h3>Say Something</h3>
<p>This is my first admin page!</p>
<?php
}
}
new APF; Create a Form<?php
/* Plugin Name: Admin Page Framework - My First Form */
include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.php' );
class APF_MyFirstFrom extends AdminPageFramework {
public function setUp() {
$this->setRootMenuPage( 'My Settings' ); // create a root page
$this->addSubMenuItem(
array(
'title' => 'My First Form',
'page_slug' => 'my_first_form'
)
);
}
/**
* The pre-defined callback method that is triggered when the page loads.
* @callback action load_{page slug}
*/
public function load_my_first_form( $oAdminPage ) {
$this->addSettingSections(
array(
'section_id' => 'my_first_text_section',
'page_slug' => 'my_first_form',
)
);
$this->addSettingFields(
array(
'field_id' => 'text',
'section_id' => 'my_first_text_section',
'title' => 'Text',
'type' => 'text',
'default' => 123456,
),
array(
'field_id' => 'submit',
'type' => 'submit',
)
);
}
}
new APF_MyFirstFrom; See more code examples in ResourcesGetting HelpedContributionsAnyone is welcome to contribute to Admin Page Framework. There are various ways you can contribute:
Browser CompatibilityInternet Explorer 9 or below is not supported. The framework uses
Framework Core DevelopmentSee the contribution guideline. Supporting Future DevelopmentIf you like the library, please rate and review it in the WordPress Plugin Directory. Also donation would be greatly appreciated. Thank you! Copyright and LicenseAdmin Page Framework (Framework Files)Admin Page Framework - Loader (WordPress Plugin) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论