本文整理汇总了PHP中Varien_Data_Form::getAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::getAction方法的具体用法?PHP Varien_Data_Form::getAction怎么用?PHP Varien_Data_Form::getAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::getAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
protected function _prepareForm()
{
$this->setTemplate('urlrewrite/form.phtml');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$fieldset = $form->addFieldset('add_urlrewrite_form', array('legend' => Mage::helper('adminhtml')->__('General Information')));
$fieldset->addField('product_id', 'hidden', array('name' => 'product_id'));
$fieldset->addField('category_id', 'hidden', array('name' => 'category_id'));
$fieldset->addField('product_name', 'note', array('label' => Mage::helper('adminhtml')->__('Product'), 'text' => 'product_name'));
$fieldset->addField('category_name', 'note', array('label' => Mage::helper('adminhtml')->__('Category'), 'text' => 'category_name'));
if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'select', array('label' => $this->__('Store'), 'title' => $this->__('Store'), 'name' => 'store_id', 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()));
} else {
$fieldset->addField('store_id', 'select', array('name' => 'store_id', 'label' => $this->__('Store'), 'title' => $this->__('Store'), 'required' => true, 'value' => Mage::app()->getStore(true)->getId(), 'options' => array('' => '', Mage::app()->getStore(true)->getId() => Mage::app()->getStore(true)->getName())));
}
$fieldset->addField('id_path', 'text', array('label' => Mage::helper('adminhtml')->__('ID Path'), 'title' => Mage::helper('adminhtml')->__('ID Path'), 'name' => 'id_path', 'required' => true));
$fieldset->addField('request_path', 'text', array('label' => Mage::helper('adminhtml')->__('Request Path'), 'title' => Mage::helper('adminhtml')->__('Request Path'), 'name' => 'request_path', 'required' => true));
$fieldset->addField('target_path', 'text', array('label' => Mage::helper('adminhtml')->__('Target Path'), 'title' => Mage::helper('adminhtml')->__('Target Path'), 'name' => 'target_path', 'required' => true));
$fieldset->addField('options', 'select', array('label' => Mage::helper('adminhtml')->__('Redirect'), 'title' => Mage::helper('adminhtml')->__('Redirect'), 'name' => 'options', 'options' => array('' => Mage::helper('adminhtml')->__('No'), 'R' => Mage::helper('adminhtml')->__('Yes'))));
$fieldset->addField('description', 'textarea', array('label' => Mage::helper('adminhtml')->__('Description'), 'title' => Mage::helper('adminhtml')->__('Description'), 'name' => 'description', 'cols' => 20, 'rows' => 5, 'wrap' => 'soft'));
$gridFieldset = $form->addFieldset('add_urlrewrite_grid', array('legend' => Mage::helper('adminhtml')->__('Please select a product')));
$gridFieldset->addField('products_grid', 'note', array('text' => $this->getLayout()->createBlock('adminhtml/urlrewrite_product_grid')->toHtml(), 'disabled' => true));
$gridFieldset = $form->addFieldset('add_urlrewrite_category', array('legend' => Mage::helper('adminhtml')->__('Please select a category')));
$gridFieldset->addField('category_tree', 'note', array('text' => $this->getLayout()->createBlock('adminhtml/urlrewrite_category_tree')->toHtml(), 'disabled' => true));
$gridFieldset = $form->addFieldset('add_urlrewrite_type', array('legend' => Mage::helper('adminhtml')->__('Please select a type')));
$gridFieldset->addField('type', 'select', array('label' => Mage::helper('adminhtml')->__('Type'), 'title' => Mage::helper('adminhtml')->__('Type'), 'name' => 'type', 'required' => true, 'options' => array('' => '', Mage_Core_Model_Url_Rewrite::TYPE_CATEGORY => Mage::helper('adminhtml')->__('Category'), Mage_Core_Model_Url_Rewrite::TYPE_PRODUCT => Mage::helper('adminhtml')->__('Product'), Mage_Core_Model_Url_Rewrite::TYPE_CUSTOM => Mage::helper('adminhtml')->__('Custom'))));
$form->setUseContainer(true);
$form->setAction($form->getAction() . 'ret/' . $this->getRequest()->getParam('ret'));
$this->setForm($form);
return parent::_prepareForm();
}
示例2: _prepareForm
protected function _prepareForm()
{
$model = Mage::registry('tag_tag');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'ret' => Mage::registry('ret'))), 'method' => 'post'));
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('tag')->__('General Information')));
if ($model->getTagId()) {
$fieldset->addField('tag_id', 'hidden', array('name' => 'tag_id'));
}
$fieldset->addField('name', 'text', array('name' => 'name', 'label' => Mage::helper('tag')->__('Tag Name'), 'title' => Mage::helper('tag')->__('Tag Name'), 'required' => true));
$fieldset->addField('status', 'select', array('label' => Mage::helper('tag')->__('Status'), 'title' => Mage::helper('tag')->__('Status'), 'name' => 'status', 'required' => true, 'options' => array(Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('tag')->__('Disabled'), Mage_Tag_Model_Tag::STATUS_PENDING => Mage::helper('tag')->__('Pending'), Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'))));
$form->setValues($model->getData());
$form->setUseContainer(true);
$form->setAction($this->getUrl($form->getAction(), array('ret' => $this->getRequest()->getParam('ret'), 'customer_id' => $this->getRequest()->getParam('customer_id'), 'product_id' => $this->getRequest()->getParam('product_id'))));
$this->setForm($form);
return parent::_prepareForm();
}
示例3: _prepareForm
protected function _prepareForm()
{
$model = AO::registry('tag_tag');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$fieldset = $form->addFieldset('base_fieldset', array('legend' => AO::helper('tag')->__('General Information')));
if ($model->getTagId()) {
$fieldset->addField('tag_id', 'hidden', array('name' => 'tag_id'));
}
$fieldset->addField('name', 'text', array('name' => 'name', 'label' => AO::helper('tag')->__('Tag Name'), 'title' => AO::helper('tag')->__('Tag Name'), 'required' => true));
$fieldset->addField('status', 'select', array('label' => AO::helper('tag')->__('Status'), 'title' => AO::helper('tag')->__('Status'), 'name' => 'status', 'required' => true, 'options' => array(Mage_Tag_Model_Tag::STATUS_DISABLED => AO::helper('tag')->__('Disabled'), Mage_Tag_Model_Tag::STATUS_PENDING => AO::helper('tag')->__('Pending'), Mage_Tag_Model_Tag::STATUS_APPROVED => AO::helper('tag')->__('Approved'))));
if (!$model->getId() && !AO::getSingleton('adminhtml/session')->getTagData()) {
$model->setStatus(Mage_Tag_Model_Tag::STATUS_APPROVED);
}
if (AO::getSingleton('adminhtml/session')->getTagData()) {
$form->setValues(AO::getSingleton('adminhtml/session')->getTagData());
AO::getSingleton('adminhtml/session')->setTagData(null);
} else {
$form->setValues($model->getData());
}
$form->setUseContainer(true);
$form->setAction($form->getAction() . 'ret/' . $this->getRequest()->getParam('ret'));
$this->setForm($form);
return parent::_prepareForm();
}