我必须更新Symfony中的多个列,但我无法找到解决方案......所以,我想这样做:
$q = Doctrine_Query::create()
->update('WebusersTable q')
->set('q.login_name','?','John')
->where('q.webuser_id=?',1)
->execute();
Run Code Online (Sandbox Code Playgroud)
好的,这有效,但我必须用几个列来做.我试过这样的东西,但它不起作用:
$q = Doctrine_Query::create()
->update('WebusersTable q')
->set('q.login_name,q.name','?','kaka,pisa')
->where('q.webuser_id=?',1)
->execute();
Run Code Online (Sandbox Code Playgroud) 我在 Heroku 中部署了一个 shopify 应用程序,用 Rails 开发。我需要从任何 shopify 商店的前端调用 javascript 函数。我读过这篇文章(http://www.shopify.com/technology/3033852-shopify-api-update-scripttags-javascript-insertion),但我不明白......
我必须把这段代码放在哪里:
HTTP POST http://their-shop.myshopify.com/admin/scripttags
<?xml version="1.0" encoding="UTF-8"?>
<script-tag>
<src>http://example.com/your-awesome-script.js</src>
<event>onload</event>
</script-tag>
Run Code Online (Sandbox Code Playgroud)
src 标签应该是什么(对于我部署的 rails 应用程序),我应该把 javascript 调用函数放在哪里?
我有一个奇怪的问题与复选框验证.它总是无效的...我已经阅读了很多关于这个问题,但我找不到解决方案...(我在验证中使用array_keys)所以,这是我的代码:
class NetworkDevicesAndInterfacesForm extends sfForm {
public function configure() {
$optionsArr = array('one' => 'One','two' => 'Two');
$this->setWidgets(array(
'devices' => new sfWidgetFormChoice(array(
'expanded' => true,
'multiple' => true,
'choices' => $optionsArr),
array('class' => 'checkbox'))
));
$this->setValidators(array(
'devices' => new sfValidatorChoice(array(
'choices' => array_keys($optionsArr)),
array('required' => 'Please choose something!'))
));
$this->widgetSchema->setLabels(array(
'devices' => ' '
));
$this->widgetSchema->setNameFormat('devices[%s]');
}
}
Run Code Online (Sandbox Code Playgroud)
行动:
if ($request->isMethod('post')) {
$this->form->bind($request->getParameter('devices'));
if ($this->form->isValid()) {
$formValues = $this->form->getValues();
$deviceId = $formValues['devices'];
}
}
Run Code Online (Sandbox Code Playgroud)