我想在我的DefaultController中为TWIG模板设置以下标题:
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Origin: http://www.mywebsite.com');
header('Access-Control-Allow-Headers: Content-Type, *');
Run Code Online (Sandbox Code Playgroud)
有什么建议怎么做?
如何通过点击获取行ID?实际上我想将远程表的行ID分配给网格的每一行,通过点击它,我想加载第二个网格.有解决方案吗
我想通过调用它的对象来动态访问Symfony2实体方法.例如:
$entityObj = new Products();
// Generic Table Processor to process the table data
private function tableProcessor($entityObject){
// how can I get all the Entity methods inside the Products Entity????
// e.g; $entityObject.getMethods(); // should return all the methods?
return $entityObject;
}
Run Code Online (Sandbox Code Playgroud)
如果整理出来!我确信这个程序会帮助我编写更少的代码,否则我将不得不为超过10-20个实体编写代码.