本文整理汇总了PHP中Chamilo\CoreBundle\Framework\Container::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getRequest方法的具体用法?PHP Container::getRequest怎么用?PHP Container::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chamilo\CoreBundle\Framework\Container
的用法示例。
在下文中一共展示了Container::getRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
$course['exemplary_content'] = empty($course['exemplary_content']) ? false : true;
$course['teachers'] = $course_teachers;
//$course['user_id'] = $teacher_id;
$course['wanted_code'] = $course['visual_code'];
$course['gradebook_model_id'] = isset($course['gradebook_model_id']) ? $course['gradebook_model_id'] : null;
// Fixing category code
$course['course_category'] = $course['category_code'];
$course_info = CourseManager::create_course($course);
header('Location: course_list.php'.($course_info===false?'?action=show_msg&warn='.api_get_last_failure():''));
exit;
}*/
// Display the form.
$content = $form->return_form();
//echo $content;
$em = Container::getEntityManager();
$request = Container::getRequest();
$course = new Course();
$builder = Container::getFormFactory()->createBuilder(new CourseType(), $course);
$form = $builder->getForm();
$form->handleRequest($request);
if ($form->isValid()) {
$course = $form->getData();
$em->persist($course);
$em->flush();
Container::addFlash(get_lang('Updated'));
$url = Container::getRouter()->generate('main', array('name' => 'admin/course_list.php'));
header('Location: ' . $url);
exit;
}
echo Container::getTemplate()->render('ChamiloCoreBundle:Legacy:form.html.twig', array('form' => $form->createView(), 'url' => api_get_self()));
示例2: api_get_self
/**
* Returns an escaped version of $_SERVER['PHP_SELF'] to avoid XSS injection
* @return string Escaped version of $_SERVER['PHP_SELF']
*/
function api_get_self()
{
//return htmlentities($_SERVER['PHP_SELF']);
return htmlentities(Container::getRequest()->server->get('PHP_SELF'));
//return htmlentities(Container::getRequest()->getUri());
}