<?php
namespace Dp\DriveplusBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Dp\DriveplusBundle\Entity\Messageboard;
class MessageController extends Controller
{
public function indexAction()
{
$em = $this->getDoctrine()->getEntityManager();
$query = $em->createQuery(
'SELECT m FROM DpDriveplusBundle:Messageboard m ORDER BY m.id DESC'
);
$comments = $query->getResult();
$count = count($comments);
return $this->render('DpDriveplusBundle:Message:index.html.twig', array('comments'=>$comments, 'count'=>$count));
}
public function ajaxAction()
{
$request = $this->getRequest();
$ret = '';
if ('POST' === $request->getMethod()) {
$name = $request->get('name');
$message = $request->get('message');
$ret = '姓名:'.$name.'<br/> 留言内容:'.$message.'<hr/>';
$comment = new Messageboard();
$comment->setName($name);
$comment->setMessage($message);
$em = $this->getDoctrine()->getEntityManager();
$em->persist($comment);
$em->flush();
return new Response($ret);
}
}
}
欢迎使用阳光订餐系统,本系统使用PHP5+MYSQL开发而成,距离上一个版本1.2.8发布已经有一年了。本系统集成了留言本,财务管理,菜单管理,员工管理,安全管理,WAP手机端等功能,并继续继承1.X老版本简单、实用、美观的特点,在老版本上的基础上做了如下更新:1.更简洁的前台与后台,菜单及功能布局更合理。2.更合理的文件结构,合理适度的模板机制以及OO运用,更易于理解的代码,更适于二次开发;3.
2
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号