1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-30 00:10:31 +02:00

Slim Framework integration #118 #117

- Snippets: refactoring
This commit is contained in:
Awilum
2019-05-29 00:37:24 +03:00
parent b8f04df7af
commit e8ff6c9532

View File

@@ -86,9 +86,8 @@ class Snippets
// If there is any snippets file then go...
if (count($_snippets) > 0) {
foreach ($_snippets as $snippet) {
if ($snippet['type'] == 'file' && $snippet['extension'] == 'json') {
$snippet_content = JsonParser::decode(Filesystem::read($snippet['path']));
$snippet[$snippet['basename']] = $snippet_content['title'];
if ($snippet['type'] == 'file' && $snippet['extension'] == 'php') {
$snippet[$snippet['basename']] = $snippet['basename'];
}
}
}
@@ -232,4 +231,15 @@ class Snippets
{
return PATH['snippets'] . '/' . $id . '.php';
}
/**
* Helper method _dir_location
*
* @access private
* @return string
*/
private function _dir_location() : string
{
return PATH['snippets'] . '/';
}
}