add label_attr attribute to form smarty plugin
This commit is contained in:
@@ -71,10 +71,12 @@ class Cart extends BaseLoop
|
||||
*/
|
||||
public function exec(&$pagination)
|
||||
{
|
||||
$cartItems = $cart->getCartItems();
|
||||
|
||||
$result = new LoopResult($cartItems);
|
||||
|
||||
|
||||
$cart = $this->getCart($this->request);
|
||||
$cartItems = $cart->getCartItems();
|
||||
$result = new LoopResult($cartItems);
|
||||
|
||||
if ($cart === null) {
|
||||
return $result;
|
||||
|
||||
@@ -123,6 +123,7 @@ class Form extends AbstractSmartyPlugin
|
||||
$template->assign("name", $formFieldView->vars["full_name"]);
|
||||
$template->assign("value", $formFieldView->vars["value"]);
|
||||
$template->assign("label", $formFieldView->vars["label"]);
|
||||
$template->assign("label_attr", $formFieldView->vars["label_attr"]);
|
||||
|
||||
$errors = $formFieldView->vars["errors"];
|
||||
|
||||
|
||||
@@ -67,6 +67,10 @@ class CartAdd extends BaseForm
|
||||
new Constraints\Callback(array("methods" => array(
|
||||
array($this, "checkProduct")
|
||||
)))
|
||||
),
|
||||
"label" => "product",
|
||||
"label_attr" => array(
|
||||
"for" => "cart_product"
|
||||
)
|
||||
))
|
||||
->add("product_sale_elements_id", "text", array(
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{form_error form=$form field="product"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
<label>{intl l="product"}: </label><input type="text" name="{$name}" value="{$value}" {$attr} ><br />
|
||||
<label for="{$label_attr.for}">{intl l="{$label}"}: </label><input id="{$label_attr.for}" type="text" name="{$name}" value="{$value}" {$attr} ><br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='product_sale_elements_id'}
|
||||
|
||||
Reference in New Issue
Block a user