在我的symfony控制器脚本中,我传递了购物车的数量。而且我能够获得print_r如下。我面临的问题是我尝试了各种方法来获取数量而没有成功,可以帮助我如何获取此数量元素
public function detailsAction($id, Request $request)
{
$book = $this->getDoctrine()
->getRepository('AppBundle:Booklist')
->find($id);
print_r($request->request->get('form'));
die($request->request->get('form'));
return $this->render('books/details.html.twig', array('book' => $book, 'quantity' => 1));
}
使用print_r
Array ( [quantity] => 1 [Add to Cart] => [_token] => Y8XHbH7lHphAFQ5lIjhQShoIleeSj9iGpen1rhxTBz4 ) Array
有人可以帮助我获取数量吗?
答案 0 :(得分:1)
您已抛弃GLuint shader_prog = .... ; // shader program object
float width = .... ; // viewport width in pixel
float height = .... ; // viewport height in pixel
float prj_mat[] =
{
2.0f/width, 0.0f, 0.0f, 0.0f,
0.0f, -2.0f/height, 0.0f, 0.0f,
0.0f, 0.0f, -1.0f, 0.0f,
-1.0f, 1.0f, 0.0f, 1.0f
};
glLinkProgram( shader_prog );
GLint prj_loc = glGetUniformLocation( shader_prog, "u_projection" );
glUseProgram( shader_prog );
glUniformMatrix4fv( prj_loc, 1, GL_FALSE, prj_mat );
,其中有数量。数量应该很容易。
$request->request->get('form')