Using BladeOne again, got the admin page to show
This commit is contained in:
parent
fa1807f5fc
commit
1d695ea372
@ -44,16 +44,16 @@ class AdminSettings {
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return string
|
||||
* @return void
|
||||
*/
|
||||
public function show_main_settings_page(): string {
|
||||
public function show_main_settings_page(): void {
|
||||
$data = array();
|
||||
$this->localize_script();
|
||||
|
||||
ob_start();
|
||||
echo nmsp_plugin_app()->blade->run( 'admin.settings', $data );
|
||||
$output = ob_get_clean();
|
||||
return wp_kses_post( $output );
|
||||
echo wp_kses_post( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -66,7 +66,7 @@ class AdminSettings {
|
||||
public function register_scripts(): void {
|
||||
wp_enqueue_style( 'nmsp-plugin-name-admin-css', plugins_url( '../assets/css/nmsp-plugin-name-admin.css', __FILE__ ), array(), '1.0.0', 'screen' );
|
||||
|
||||
wp_register_script( 'nmsp-plugin-name-admin-js', plugins_url( '../assets/js/nmsp-plugin-name-admin.js', __FILE__ ), array(), '1.0.0', false );
|
||||
wp_register_script( 'nmsp-plugin-name-admin-js', plugins_url( '../assets/js/nmsp-plugin-name-admin.js', __FILE__ ), array( 'jquery' ), '1.0.0', false );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3.0",
|
||||
"eftec/bladeone": "^3.52"
|
||||
"eftec/bladeone": "^4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.0",
|
||||
|
20
composer.lock
generated
20
composer.lock
generated
@ -4,30 +4,30 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2684d1770bbee2bb8f671fbbb3919f1e",
|
||||
"content-hash": "93b4f488145c9bf1c4ecf7adad47614e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "eftec/bladeone",
|
||||
"version": "3.52",
|
||||
"version": "4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EFTEC/BladeOne.git",
|
||||
"reference": "a19bf66917de0b29836983db87a455a4f6e32148"
|
||||
"reference": "d3e1efa1c6f776aa87fe47164d77e7ea67fc196f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148",
|
||||
"reference": "a19bf66917de0b29836983db87a455a4f6e32148",
|
||||
"url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/d3e1efa1c6f776aa87fe47164d77e7ea67fc196f",
|
||||
"reference": "d3e1efa1c6f776aa87fe47164d77e7ea67fc196f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=5.6"
|
||||
"php": ">=7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.16.1",
|
||||
"friendsofphp/php-cs-fixer": "^3.1",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"squizlabs/php_codesniffer": "^3.5.4"
|
||||
"squizlabs/php_codesniffer": "^3.6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"eftec/bladeonehtml": "Extension to create forms",
|
||||
@ -60,9 +60,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/EFTEC/BladeOne/issues",
|
||||
"source": "https://github.com/EFTEC/BladeOne/tree/3.52"
|
||||
"source": "https://github.com/EFTEC/BladeOne/tree/4.1"
|
||||
},
|
||||
"time": "2021-04-17T13:49:01+00:00"
|
||||
"time": "2021-09-29T15:23:25+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
@ -164,7 +164,7 @@ class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Blade as the templating engine for the plugin.
|
||||
* Load BladeOne as the templating engine for the plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
|
@ -29,7 +29,7 @@ class CustomPage {
|
||||
public function enqueue_scripts(): void {
|
||||
wp_enqueue_style( 'nmsp-plugin-name-css', plugins_url( '../../assets/css/nmsp-plugin-name.css', __FILE__ ), array(), '1.0.0', 'screen' );
|
||||
|
||||
wp_register_script( 'nmsp-plugin-name-js', plugins_url( '../../assets/js/nmsp-plugin-name.js', __FILE__ ), array(), '1.0.0', false );
|
||||
wp_register_script( 'nmsp-plugin-name-js', plugins_url( '../../assets/js/nmsp-plugin-name.js', __FILE__ ), array( 'jquery' ), '1.0.0', false );
|
||||
wp_enqueue_script( 'nmsp-plugin-name-js' );
|
||||
|
||||
$payload = array(
|
||||
|
@ -57,8 +57,7 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
||||
require_once __DIR__ . '/includes/class-nmspcli.php';
|
||||
}
|
||||
|
||||
$mode = BladeOne::MODE_DEBUG; // Can also be MODE_AUTO|MODE_DEBUG
|
||||
$blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade', $mode );
|
||||
$blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade' );
|
||||
|
||||
register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) );
|
||||
register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user