当前位置: 首页>>代码示例>>PHP>>正文


PHP Button::setName方法代码示例

本文整理汇总了PHP中Zend\Form\Element\Button::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Button::setName方法的具体用法?PHP Button::setName怎么用?PHP Button::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Form\Element\Button的用法示例。


在下文中一共展示了Button::setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(EntityManager $em)
 {
     parent::__construct();
     $this->em = $em;
     $this->add(['name' => 'id', 'attributes' => ['type' => 'hidden']])->add(['name' => 'name', 'options' => ['label' => 'Role Name'], 'attributes' => ['type' => 'text', 'placeholder' => 'Role Name', 'class' => 'form-control', 'id' => 'name', 'autofocus' => 'autofocus']])->add(['type' => 'DoctrineModule\\Form\\Element\\ObjectSelect', 'name' => 'parent', 'options' => ['label' => 'Parent Role', 'object_manager' => $this->em, 'target_class' => 'ZfMuscle\\Entity\\Role', 'property' => 'roleId', 'empty_option' => '--Select--', 'is_method' => true, 'find_method' => ['name' => 'getRoles']], 'attributes' => ['class' => 'full-width', 'data-placeholder' => 'Select Parent Role', 'data-init-plugin' => 'select2', 'id' => 'parent']]);
     $submitElement = new Element\Button('submit');
     $submitElement->setName('submit')->setLabel('Save Role')->setAttributes(['type' => 'submit', 'class' => 'btn btn-primary btn-cons m-t-10', 'id' => 'addrole']);
     $this->add($submitElement, ['priority' => -100]);
 }
开发者ID:AwoyoToyin,项目名称:ZfMuscle,代码行数:9,代码来源:Role.php

示例2: __construct

 public function __construct(EntityManager $em)
 {
     parent::__construct();
     $this->em = $em;
     $hiddenElement = new Element\Hidden('id');
     $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden'));
     $this->add($hiddenElement, array());
     $this->add(array('name' => 'name', 'options' => array('label' => 'Category Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Category Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf'));
     $submitElement = new Element\Button('submit');
     $submitElement->setName('submit')->setLabel('Save Category')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addCategory'));
     $this->add($submitElement, array('priority' => -100));
 }
开发者ID:AwoyoToyin,项目名称:StockInventory,代码行数:12,代码来源:CategoryForm.php

示例3: __construct

 public function __construct(EntityManager $em)
 {
     parent::__construct();
     $this->em = $em;
     $hiddenElement = new Element\Hidden('id');
     $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden'));
     $this->add($hiddenElement, array());
     $this->add(array('name' => 'name', 'options' => array('label' => 'Product Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('name' => 'sku', 'options' => array('label' => 'SKU'), 'attributes' => array('type' => 'text', 'placeholder' => 'SKU', 'class' => 'form-control', 'id' => 'sku', 'required' => 'required')))->add(array('name' => 'price', 'options' => array('label' => 'Product Price', 'help' => 'Price must be of type float i.e 50.00'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Price', 'class' => 'form-control', 'id' => 'price', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Number', 'name' => 'qty', 'options' => array('label' => 'Qty in Stock'), 'attributes' => array('min' => '0', 'step' => '1', 'placeholder' => 'Qty in Stock', 'class' => 'form-control', 'id' => 'qty', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf'));
     $textAreaElement = new Element\Textarea('description');
     $textAreaElement->setName('description')->setLabel('Product Description')->setAttributes(array('type' => 'textarea', 'placeholder' => 'Product Description', 'class' => 'form-control', 'rows' => '3', 'id' => 'description', 'required' => 'required'));
     $this->add($textAreaElement, array());
     $submitElement = new Element\Button('submit');
     $submitElement->setName('submit')->setLabel('Save Product')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addProduct'));
     $this->add($submitElement, array('priority' => -100));
 }
开发者ID:AwoyoToyin,项目名称:StockInventory,代码行数:15,代码来源:ProductForm.php


注:本文中的Zend\Form\Element\Button::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。