对不起这篇琐碎的帖子,但我不能自己解决这个问题。
所以我基本上附加一个div,我需要maximum-length
类来获得像maximum-length-$max
这样的PHP变量,但我无法弄清楚我需要使用的语法。
我已经尝试过之前做过的事情:'.$max.'
,但这不起作用。
$addressFields .= '<div style="position: relative"><input type="text" title="'.$this->__('Street Address '.($_i+1)).'" name="billing[street]['.$_i.']" id="billing:street'.($_i+1).'" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getStreet($_i+1)).'" class="'.(($_i == 0)? 'required-entry ' : ''). 'input-text validate-address-lenght maximum-length-$max />';
答案 0 :(得分:2)
这是一个可怕的单行阅读。
我会使用sprintf执行以下操作:
include '../config.php';
function getAmount(){
global $con;
$sql = "SELECT sum(amount) AS total
FROM transaction
WHERE updated_at>'1501525800000'
AND updated_at<'1504117800000'";
$sumresult = mysqli_query($con,$sql);
$sumrow=mysqli_fetch_assoc($sumresult);
return $sumrow['total'];
}
在类值中,“validate-address-lenght”也不应该是“validate-address-length”吗?
答案 1 :(得分:1)
尝试在varable之前和之后关闭'
。请尝试以下代码:
$addressFields .= '<div style="position: relative"><input type="text" title="'.$this->__('Street Address '.($_i+1)).'" name="billing[street]['.$_i.']" id="billing:street'.($_i+1).'" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getStreet($_i+1)).'" class="'.(($_i == 0)? 'required-entry ' : ''). 'input-text validate-address-lenght maximum-length-'.$max.'" />';