mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 23:54:06 +02:00
Admin Panel: Menus Manager - removed for now. We will try to have fields for menus inside menu sections.
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Flextype
|
||||
*
|
||||
* @author Sergey Romanenko <awilum@yandex.ru>
|
||||
* @link http://flextype.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
|
||||
class Menus
|
||||
{
|
||||
/**
|
||||
* Get menu
|
||||
*
|
||||
* Menu::get('menu-name');
|
||||
*
|
||||
* @access public
|
||||
* @param string $menu_name Menu name
|
||||
* @return array
|
||||
*/
|
||||
public static function get(string $menu_name)
|
||||
{
|
||||
$menu_path = PATH['menus'] . '/' . $menu_name . '.yaml';
|
||||
|
||||
if (Filesystem::has($menu_path)) {
|
||||
return YamlParser::decode(Filesystem::read($menu_path));
|
||||
} else {
|
||||
throw new \RuntimeException("Menu {$menu_name} does not exist.");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user