我有一个输入:
<input type="text" id="name" class="form-control" name="name" v-model="form.name" :disabled="validated ? '' : disabled">
Run Code Online (Sandbox Code Playgroud)
在我的Vue.js组件中,我有:
..
..
ready() {
this.form.name = this.store.name;
this.form.validated = this.store.validated;
},
..
Run Code Online (Sandbox Code Playgroud)
validated
作为a boolean
,它可以是0
或者1
,但无论数据库中存储了什么值,我的输入始终被禁用.
我需要禁用输入false
,否则应启用并可编辑.
更新:
这样做总是启用输入(无论我在数据库中有0还是1):
<input type="text" id="name" class="form-control" name="name" v-model="form.name" :disabled="validated ? '' : disabled">
Run Code Online (Sandbox Code Playgroud)
这样做总是禁用输入(无论我在数据库中有0还是1):
<input type="text" id="name" class="form-control" name="name" v-model="form.name" :disabled="validated ? disabled : ''">
Run Code Online (Sandbox Code Playgroud) 我在auth.net上捕获事务的功能是
public function capture(Varien_Object $payment, $amount){
if(!$this->isEnabled()){
return parent::capture($payment, $amount);
}else{
$captureCase = $_POST['invoice']['capture_case'];
if(isset($captureCase) && $captureCase == "online"){
if($capOrderid = $payment->getOrder()->getIncrementId()){
$capOrder = $payment->getOrder();
$capPayment = $payment;
$capAmount = $amount;
$capTransID = $capPayment->getLastTransId();
$ccProfile = $this->getProfileForOrder($capOrderid);
if(isset($ccProfile['used_this_profile']) && $ccProfile['used_this_profile'] == 1){
$pID = $ccProfile['cust_profile_id'];
$ppID = $ccProfile['cust_paymentprofile_id'];
$nick = $ccProfile['nickname'];
$lastOrderId = $capOrder->getIncrementId();
$cvv = $payment->getCcCid();
$directResponseFields = $this->createTransaction($pID,$ppID,$capAmount,$lastOrderId,"profileTransPriorAuthCapture",$cvv,$capTransID);
$responseCode = $directResponseFields[0]; // 1 = Approved 2 = Declined 3 = Error
$responseReasonCode = $directResponseFields[2]; // See http://www.authorize.net/support/AIM_guide.pdf
$responseReasonText …
Run Code Online (Sandbox Code Playgroud) 我有一个字符串
显示324结果中的1 - 12
我想要这个字符串
324结果
要么
324
只要
注意,324是每次获得字符串时都会改变的数字.它可能是2位数(34),3或4位数.
目前我只是在使用代码丢弃显示单词时取得成功
'str_replace('Showing', '', $s)'
Run Code Online (Sandbox Code Playgroud)
这给出了
第1 - 12条,共324条搜索结果
我怎样才能使用str_replace函数来实现我的目的?或者我应该使用PHP的任何其他功能?
我有以下代码
function generate_pdf() {
$fdf_data_strings = $this->get_hash_for_pdf();
#$fdf_data_names = array('49a' => "yes");
$fdf_data_names = array();
$fields_hidden = array();
$fields_readonly = array();
$hud_pdf = ABSPATH.'../pdf/HUD3.pdf';
$fdf= forge_fdf( '',
$fdf_data_strings,
$fdf_data_names,
$fields_hidden,
$fields_readonly );
/* echo "<pre>";
print_r($fdf);
echo "</pre>";
die('');
*/
$fdf_fn= tempnam( '.', 'fdf' );
$fp= fopen( $fdf_fn, 'w' );
if( $fp ) {
fwrite( $fp, $fdf );
//$data=fread( $fp, $fdf );
// echo $data;
fclose( $fp );
header( 'Content-type: application/pdf' );
header( 'Content-disposition: attachment; filename=settlement.pdf' ); // prompt to …
Run Code Online (Sandbox Code Playgroud) 我正在使用此代码
<?php
$word = $_POST['word'];
$wid= $_POST['id'];
print "<table>";
print "<tr>";
$sql= 'SELECT url_imgsrch FROM p_url_imgsrch where 'word_id'='[$wid]' ORDER BY RAND() LIMIT 5';
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
print ' <td>
<img name="myimage" src="'.$row[0].'" width="100" height="100" alt="word" border="1"/>
</td>';
}
print "</tr>";
print "</table>";
?>
Run Code Online (Sandbox Code Playgroud)
我正在做的是使用where子句从mysql获取一个字段,但它显示错误
解析错误:语法错误,第21行的D:\ wamp\www\demo\login\card.php中的意外T_STRING
和第21行成立
$sql= 'SELECT url_imgsrch FROM p_url_imgsrch where 'word_id'='[$wid]' ORDER BY RAND() LIMIT 5';
Run Code Online (Sandbox Code Playgroud)
请指导我,我在做什么大错?请给我指导.
我认为我应该说清楚的一件事是"ord_id field"是Numeric(int)
我的网站被新手开发人员搞砸了,我没有选择删除旧文件,并安装magento 1.7.0.2的新副本.我的旧Magento版本是1.6.
我想使用旧数据库,因为我在其上获得了所有产品列表,一切都在该数据库上.我发现在我的新装置中找不到那些表(实际上它们的数量如此之多以至于几乎不可能记住它们的名字).
我尝试通过编辑local.xml将我的magento安装指向旧数据库,但是由于magento一次又一次地抛出错误而无法成功.错误是
table already exists and some description
Run Code Online (Sandbox Code Playgroud)
而对我来说,这些错误是有道理的
有人可以指导我如何将我的旧数据库指向magento没有错误或如何将我的旧数据加载到新的magento安装..
我担心简单地导入sql数据库可能无法正常工作
谢谢
我的问题可能看起来很流行,但我面临困难......
功能代码的一部分是
public function capture(Varien_Object $payment, $amount){
if(!$this->isEnabled()){
return parent::capture($payment, $amount);
}else{
---- MORE CODE--
$quote = Mage::getSingleton('customer/session');
$nickname = $quote->getAuthorizenetNickname();
$profile = $quote->getProfile();
$postedNickname = $quote->getNickname();
if ($payment->getCcTransId()) {
$payment->setAnetTransType(self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE);
} else {
$payment->setAnetTransType(self::REQUEST_TYPE_AUTH_CAPTURE);
}
$payment->setAmount($amount);
$request= $this->_buildRequest($payment);
$result = $this->_postRequest($request);
MORE CODE HERE, NOT RELEVENT TO MY ISSUE
Run Code Online (Sandbox Code Playgroud)
我在这里有两个问题
我如何通过交易ID进入
$payment->setAmount($amount);
$request= $this->_buildRequest($payment);
$result = $this->_postRequest($request);
Run Code Online (Sandbox Code Playgroud)
第二个问题是
我如何Echo /调试传递的transactionID的值
对你来说可能很容易,但我失败了
到目前为止尝试过
$payment->setTransID($payment->gerOrder->getTransID());
and
$payment->gerOrder->getTransID()
$payment->setAmount($amount);
$request= $this->_buildRequest($payment);
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助和指导
我正在尝试从网站收集所有CatID ... URL结构是......
我感兴趣的categoryId
是这种情况12436777
我的问题是
哪个最好,正则表达式或字符串爆炸?
如果正则表达式,请帮助我,我非常糟糕..
另外,我必须考虑像这样的URL
我试过了
$array = explode("http://www.abc.com/family/index.jsp?categoryId=", $loc);
foreach ($array as $part) {
$zee[] = $part[1];
}
Run Code Online (Sandbox Code Playgroud)
但它没有给我任何东西..
感谢帮助..
这是我学习目的的代码......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator
{
abstract class calculator
{
internal abstract int add();
internal abstract int sub();
internal abstract int mul();
internal abstract int div();
internal abstract double square();
internal abstract double underroot();
}
class mycalculator : calculator
{
public mycalculator() :base()
{
}
private int num1, num2;
public int opr1
{
get { return num1; }
set{num1 = value;}
}
public int opr2
{
get { return num2; }
set …
Run Code Online (Sandbox Code Playgroud)