diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..dd8a172 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,11 @@ + 'Underpin\Templates\Loaders\Templates' ] ) ); \ No newline at end of file diff --git a/composer.json b/composer.json index 5394cdf..3c07a3b 100644 --- a/composer.json +++ b/composer.json @@ -9,9 +9,13 @@ "email": "a@alexstandiford.com" } ], + "require": { + "underpin/underpin": "^2.0" + }, "autoload": { + "psr-4": {"Underpin\\Templates\\": "lib/"}, "files": [ - "templates.php" + "bootstrap.php" ] } } diff --git a/lib/abstracts/Template.php b/lib/Abstracts/Template.php similarity index 96% rename from lib/abstracts/Template.php rename to lib/Abstracts/Template.php index 9a02cb4..c1d06cb 100644 --- a/lib/abstracts/Template.php +++ b/lib/Abstracts/Template.php @@ -6,7 +6,7 @@ * @package */ -namespace Underpin_Templates\Abstracts; +namespace Underpin\Templates\Abstracts; use Underpin\Traits\Templates; use Underpin\Factories\Registry; diff --git a/lib/factories/Template_Instance.php b/lib/Factories/Template_Instance.php similarity index 75% rename from lib/factories/Template_Instance.php rename to lib/Factories/Template_Instance.php index 3e740e8..eb4e12e 100644 --- a/lib/factories/Template_Instance.php +++ b/lib/Factories/Template_Instance.php @@ -1,8 +1,8 @@ logger()->log_wp_error( 'error', $item ); + Logger::log_wp_error( 'error', $item ); return ''; } diff --git a/templates.php b/templates.php deleted file mode 100644 index 9761dcc..0000000 --- a/templates.php +++ /dev/null @@ -1,20 +0,0 @@ - function ( Underpin $plugin, $args ) { - require_once( plugin_dir_path( __FILE__ ) . 'lib/abstracts/Template.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'lib/factories/Template_Instance.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'lib/loaders/Templates.php' ); - - $plugin->loaders()->add( 'templates', [ - 'class' => 'Underpin_Templates\Loaders\Templates', - ] ); - }, -] ) ); \ No newline at end of file