diff --git a/flextype/Entries.php b/flextype/Entries.php index c8c1794d..1709533e 100755 --- a/flextype/Entries.php +++ b/flextype/Entries.php @@ -20,7 +20,7 @@ class Entries { /** - * Flextype DIC + * Flextype Dependency Container */ private $flextype; diff --git a/flextype/Plugins.php b/flextype/Plugins.php index ebc12f3e..707cd11a 100755 --- a/flextype/Plugins.php +++ b/flextype/Plugins.php @@ -19,14 +19,6 @@ use Flextype\Component\Registry\Registry; class Plugins { - /** - * An instance of the Cache class - * - * @var object - * @access private - */ - private static $instance = null; - /** * Locales array * diff --git a/flextype/bootstrap.php b/flextype/bootstrap.php index f81ce507..3a0fc8e7 100755 --- a/flextype/bootstrap.php +++ b/flextype/bootstrap.php @@ -23,12 +23,11 @@ use Slim\Http\Request; use Slim\Http\Response; /** -* The version of Flextype -* -* @var string -*/ -// const VERSION = '0.8.3'; - + * The version of Flextype + * + * @var string + */ +define ('FLEXTYPE_VERSION', '0.8.3'); // Set empty settings array Registry::set('settings', []); @@ -108,11 +107,19 @@ $config = ['settings' => [ 'addContentLengthHeader' => false, ]]; +/** + * Create new application + */ $app = new \Slim\App($config); -// DIC configuration +/** + * Set Flextype Dependency Container + */ $flextype = $app->getContainer(); +/** + * Add images service to Flextype container + */ $flextype['images'] = function($container) { // Set source filesystem @@ -170,6 +177,9 @@ $flextype['images'] = function($container) { ); }; +/** + * Add shortcodes service to Flextype container: + */ $flextype['shortcodes'] = function($container) { return new ShortcodeFacade(); }; @@ -182,11 +192,16 @@ foreach ($shortcodes_list as $shortcode) { include_once $shortcode['path']; } +/** + * Add entries service to Flextype container + */ $flextype['entries'] = function($container) { return new Entries($container); }; -// Register Twig View helper +/** + * Add view service to Flextype container + */ $flextype['view'] = function ($container) { $view = new \Slim\Views\Twig(PATH['site'], [ @@ -204,8 +219,12 @@ $flextype['view'] = function ($container) { return $view; }; -// Get Plugins Instance +/** + * Init plugins + */ $plugins = new Plugins($flextype, $app); -// Run app +/** + * Run application + */ $app->run(); diff --git a/site/plugins/site/site.php b/site/plugins/site/site.php index 846a9a1e..24d68976 100644 --- a/site/plugins/site/site.php +++ b/site/plugins/site/site.php @@ -9,8 +9,9 @@ use Flextype\Component\Arr\Arr; use Flextype\Component\Event\Event; use Flextype\Component\Registry\Registry; - -// Define app routes +/** + * Define site plugin routes + */ $app->get('{uri:.+}', function (Request $request, Response $response, array $args) { // Get uri @@ -55,9 +56,6 @@ $app->get('{uri:.+}', function (Request $request, Response $response, array $arg $entry['template'] = Registry::get('settings.entries.error404.template'); } - // Set current requested entry data to global $entry array - $entry = $entry; - $path = 'themes/' . Registry::get('settings.theme') . '/' . (empty($entry['template']) ? 'templates/default' : 'templates/' . $entry['template']) . '.twig'; return $this->view->render($response, diff --git a/site/plugins/site/templates/test.twig b/site/plugins/site/templates/test.twig deleted file mode 100644 index e282602b..00000000 --- a/site/plugins/site/templates/test.twig +++ /dev/null @@ -1,3 +0,0 @@ -{{ test }} -{{ entries_fetch('home')['title'] }} -@ {{ current_path() }} @