本文整理汇总了PHP中Utilities::getMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::getMenu方法的具体用法?PHP Utilities::getMenu怎么用?PHP Utilities::getMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::getMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($username)
{
$username = strip_tags(htmlspecialchars($username));
$perfil = Perfil::where('username', '=', $username)->get();
$session = Utilities::getSession();
$links = Utilities::getMenu($session);
$logged = false;
$maestro = null;
if (count($perfil) > 0) {
$maestro = Maestro::with('cursos', 'perfil')->where('maestro_id', '=', $perfil[0]->perfil_id)->get();
if (count($maestro) > 0) {
$maestro = $maestro[0];
foreach ($maestro->cursos as $key => $value) {
$action = '/curso/' . $value->nombre;
$value->action = $action;
}
} else {
$maestro = null;
}
}
if (strcmp($username, $session['username'])) {
$logged = true;
}
$this->view = new MaestroView($maestro, $links, $logged);
$this->view->display();
//Utilities::printData( $maestro );
}
示例2: usersList
public function usersList($username)
{
$session = Utilities::getSession();
$username = strip_tags(htmlspecialchars($username));
$username = filter_var($username, FILTER_SANITIZE_STRING);
if ($session['username'] == $username) {
$users = User::with('perfil', 'level')->where('level_id', '=', 4)->get();
$links = Utilities::getMenu($session);
foreach ($users as $key => $value) {
$action = '/' . $value->perfil->username;
$value->perfil->action = $action;
}
$this->view = new UsersListView($users, $links);
$this->view->display();
} else {
$this->app->redirect($app->urlFor('admin-login'));
}
}
示例3: index
public function index()
{
date_default_timezone_set('America/Mexico_City');
$total_alumnos = 12;
$fecha_actual = date('Y-m-d');
$fecha_actual = date_create($fecha_actual);
$cursos = Curso::where('status', '=', 1)->where('total_alumnos', '<', $total_alumnos)->get();
$lista_cursos = array();
$session = Utilities::getSession();
$links = Utilities::getMenu($session);
foreach ($cursos as $key => $value) {
$fechaInicio = date_create($value->fechaInicio);
$interval = date_diff($fecha_actual, $fechaInicio);
if ($interval->invert == 0 && $interval->d >= 0) {
$value->action = '/suscribirme/' . $value->curso_id;
$lista_cursos[] = $value;
}
}
//Utilities::printData( $lista_cursos );
$this->view = new Index($this->app->urlFor('join'), $lista_cursos, $links);
$this->view->display();
}
示例4: cambiarFotoView
public function cambiarFotoView($params)
{
$usuario_id = strip_tags(htmlspecialchars($params['usuario']));
$usuario_id = intval($usuario_id);
$usuario_id = filter_var($usuario_id, FILTER_VALIDATE_INT);
$error = 0;
if (!$usuario_id || $usuario_id == 0) {
$error = 1;
}
$usuario = Perfil::find($usuario_id);
if (count($usuario) == 0) {
$error = 2;
}
$action = '/usuario/' . $usuario_id . '/foto/';
$session = Utilities::getSession();
$links = Utilities::getMenu($session);
$this->view = new FotoView($action, Utilities::createToken(), $usuario, $links, $error);
$this->view->display();
}
示例5: editView
public function editView($params)
{
$curso_id = strip_tags(htmlspecialchars($params['curso']));
$curso_id = intval($curso_id);
$curso_id = filter_var($curso_id, FILTER_VALIDATE_INT);
$attempt = 0;
$session = Utilities::getSession();
$links = Utilities::getMenu($session);
if (isset($params['attempt']) && is_int($params['attempt'])) {
$attempt = strip_tags(htmlspecialchars($params['attempt']));
$attempt = intval($attempt);
$attempt = filter_var($attempt, FILTER_VALIDATE_INT);
}
if (!$curso_id) {
$this->app->redirect($this->app->urlFor('Index'));
}
$curso = Curso::find($curso_id);
if (count($curso) == 0) {
$this->app->redirect($this->app->urlFor('Index'));
}
$action = '/curso/' . $curso->curso_id . '/edit';
$tipo_curso = TipoCurso::all();
$maestros = Maestro::with('perfil')->get();
$this->view = new CursoEditView($links, $curso, $tipo_curso, $maestros, $action, $attempt);
$this->view->display();
//Utilities::printData($maestros);
}