$("#ajax").click(function(){
$.ajax({
type: "GET",
url: "/admin",
headers: {'X-Requested-With': 'XMLHttpRequest'},
success: function(msg){
alert(msg);
},
error: function(msg){
console.log(msg);
},
});
});
class DefaultController extends Controller
{
public function indexAction()
{
$request = $this->get('request');
return new Response(var_dump($request->isXmlHttpRequest()));
}
}
$("#ajax").click(function(){
$.ajax({
type: "GET",
url: "/admin",
headers: {'X-Requested-With': 'XMLHttpRequest'},
success: function(msg){
alert(msg);
},
error: function(msg){
console.log(msg);
},
});
});
class DefaultController extends Controller
{
public function indexAction()
{
$request = $this->get('request');
return new Response(var_dump($request->isXmlHttpRequest()));
}
}
/**
* @ORM\Id()
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\OneToMany(targetEntity="ACVote\ElectoratesBundle\Entity\Electorates", mappedBy="votes", cascade={"all"})
*/
protected $id;
#######
/**
* @ORM\Column(name="vote_id", type="integer")
* @ORM\ManyToOne(targetEntity="ACVote\VotesBundle\Entity\Votes", inversedBy="id")
* @ORM\JoinColumn(name="Vote_id", referencedColumnName="id")
*/
private $vote_id;