<?php
namespace front\view;

class Menu
{
  public static function pages( $pages, $level = 0, $current_page = 0 )
  {
    $tpl = new \Tpl;
    $tpl -> pages         = $pages;
    $tpl -> level         = $level;
    $tpl -> current_page  = $current_page;
    return $tpl -> render( 'menu/pages' );
  }
  
  public static function main_menu( $menu, $current_page )
  {
    
    $tpl = new \Tpl;
    $tpl -> menu         = $menu;
    $tpl -> current_page = $current_page;
    return $tpl -> render( 'menu/main-menu' );
  }
  
  public static function menu( $menu, $current_page )
  {
    
    $tpl = new \Tpl;
    $tpl -> menu         = $menu;
    $tpl -> current_page = $current_page;
    return $tpl -> render( 'menu/menu' );
  }
  
  public static function submenu( $pages, $current_page, $page_id, $level = 0 )
  {
    $tpl = new \Tpl;
    $tpl -> page_id       = $page_id;
    $tpl -> pages         = $pages;
    $tpl -> current_page  = $current_page;
    $tpl -> level         = $level;
    return $tpl -> render( 'menu/submenu' );
  }
}
