这听起来应该是互联网上的解决方案,但我不知道为什么我找不到它.我想在移动设备上禁用水平滚动.基本上试图实现这个目标:
body{
overflow-x:hidden // disable horizontal scrolling.
}
Run Code Online (Sandbox Code Playgroud)
这可能是相关的信息:我的头标记也是如此,因为我也不希望用户能够缩放:
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />
<meta name="viewport" content="width=device-width" />
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在使用Symfony 2.3,当我尝试列出项目时,我得到了这个异常:
The target-entity Weber\ProjectBundle\Entity\SurveyUrl cannot be found in 'Weber\ProjectBundle\Entity\Project#surveyUrls'.
Run Code Online (Sandbox Code Playgroud)
我的实体的简化是:
Project.php:
<?php
namespace Weber\ProjectBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Project
*
* @ORM\Entity
*/
class Project
{
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="Respondent", mappedBy="project")
*/
protected $respondents;
/**
* @ORM\OneToMany(targetEntity="SurveyUrl", mappedBy="project")
*/
protected $surveyUrls;
/**
* Constructor
*/
public function __construct()
{
$this->respondents = new ArrayCollection();
$this->surveyUrls = new ArrayCollection();
}
/**
* Add …
Run Code Online (Sandbox Code Playgroud) 我想在我的网站上进行动画,只有当用户第一次访问网站时才会如此.我找到了"第一次访问者"代码localStorage
,但我没有找到这个.
我一直在尝试使用Symfony2.3上传单个文件时遇到问题.当我尝试上传文件时,我收到以下错误:
FatalErrorException: Error: Call to a member function move() on a non-object in
Run Code Online (Sandbox Code Playgroud)
我检查了$csvFileForm['csvFile']->getData();
它的一个字符串(文件的名称),也$file = $this->getRequest()->files;
有零大小.
这是show动作:
/**
* Finds and displays a Project entity.
*
* @Route("/{id}", name="console_project_show")
* @Method("GET")
* @Template()
*/
public function showAction($id)
{
$csvFileForm = $this->createFormBuilder()
->add('csvFile', 'file')
->getForm();
return array(
'csvFileForm' => $csvFileForm->createView()
);
}
Run Code Online (Sandbox Code Playgroud)
并且模板中的表单如下所示:
<form method="POST" action="{{ path('console_project_upload_urls', { 'id': entity.id }) }}" >
{{ form_row(csvFileForm.csvFile) }}
{{ form_row(csvFileForm._token) }}
<input type="submit" name="submit" class="submit"/>
</form>
Run Code Online (Sandbox Code Playgroud)
上传操作是这样的:
/**
* …
Run Code Online (Sandbox Code Playgroud)