- 浏览: 80137 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
shuishui8310:
开公司了?
Magento学习课程继续 -
yanggaojiao:
对不起,很久没上这里了,在CMS->Home->D ...
Magento在首页自定制Block的方法 -
beautiful_good:
hi,你好我用的是magento 1.4.2.0版本的,请问如 ...
Magento在首页自定制Block的方法 -
as3291363:
太慢了....
Magento 1.4.1.0 的CMS太酷了 -
richardlovejob:
这个分享是在太及时了,谢谢。
Magento Events分析和使用实例与技巧
开发Magento后台的时候经常用到表单(Varien_Data_Form),下面是所有表单元素的添加方法:
1.input type=”text”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
$fieldset->addField(‘title’, ‘text’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Title3′),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “alert(‘on click’);”,
‘onchange’ => “alert(‘on change’);”,
‘style’ => “border:10px”,
‘value’ => ‘hello !!’,
‘disabled’ =>
false
,
‘readonly’ =>
true
,
‘after_element_html’ => ‘Comments’,
‘tabindex’ =>
1
));
|
2.Time时间类型
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$fieldset->addField(‘time’, ‘time’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Time’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
12
,
04
,
15
′,
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
3.textarea
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$fieldset->addField(‘textarea’, ‘textarea’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘TextArea’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ‘<b><b/>’,
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ‘<small>Comments</small>’,
‘tabindex’ =>
1
));
|
4.input type=”submit”
1
2
3
4
5
6
7
|
$fieldset->addField(‘submit’, ‘submit’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Submit’),
‘required’ =>
true
,
‘value’ => ‘Submit’,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
5.select option
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
$fieldset->addField(‘select’, ‘select’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Select’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
1
′,
‘values’ => array(‘-
1
′=>’Please Select..’,’
1
′ => ‘Option1′,’
2
′ => ‘Option2′, ’
3
′ => ‘Option3′),
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
6.带optgroup的select
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$fieldset->addField(‘select2′, ‘select’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Select Type2′),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
4
′,
‘values’ => array(
‘-
1
′=>’Please Select..’,
’
1
′ => array(
‘value’=> array(array(‘value’=>’
2
′ , ‘
label
’ => ‘Option2′) , array
(‘value’=>’
3
′ , ‘
label
’ =>’Option3′) ),
‘
label
’ => ‘Size’
),
’
2
′ => array(
‘value’=> array(array(‘value’=>’
4
′ , ‘
label
’ => ‘Option4′) , array
(‘value’=>’
5
′ , ‘
label
’ =>’Option5′) ),
‘
label
’ => ‘Color’
),
),
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
7.单选框input type=”radio”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
$fieldset->addField(‘radio’, ‘radio’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Radio’),
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
1
′,
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
$fieldset->addField(‘radio2′, ‘radios’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Radios’),
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
2
′,
‘values’ => array(
array(‘value’=>’
1
′,’
label
’=>’Radio1′),
array(‘value’=>’
2
′,’
label
’=>’Radio2′),
array(‘value’=>’
3
′,’
label
’=>’Radio3′),
),
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
8.Password元素 input type=”password
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
$fieldset->addField(‘password’, ‘password’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Password’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘style’ => “”,
‘value’ => ‘hello !!’,
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
$fieldset->addField(‘obscure’, ‘obscure’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Obscure’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘obscure’,
‘onclick’ => “”,
‘onchange’ => “”,
‘style’ => “”,
‘value’ => ’
123456789
′,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
9.Note
1
2
3
|
$fieldset->addField(‘note’, ‘note’, array(
‘text’ => Mage::helper(‘form’)->__(‘Text Text’),
));
|
10.Multiselect复选框
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$fieldset->addField(‘multiselect2′, ‘multiselect’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Select Type2′),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “
return
false
;”,
‘onchange’ => “
return
false
;”,
‘value’ => ’
4
′,
‘values’ => array(
‘-
1
′=> array( ‘
label
’ => ‘Please Select..’, ‘value’ => ‘-
1
′),
’
1
′ => array(
‘value’=> array(array(‘value’=>’
2
′ , ‘
label
’ => ‘Option2′) , array
(‘value’=>’
3
′ , ‘
label
’ =>’Option3′) ),
‘
label
’ => ‘Size’
),
’
2
′ => array(
‘value’=> array(array(‘value’=>’
4
′ , ‘
label
’ => ‘Option4′) , array
(‘value’=>’
5
′ , ‘
label
’ =>’Option5′) ),
‘
label
’ => ‘Color’
),
),
‘disabled’ =>
false
,
‘readonly’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
11.Multiline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
$fieldset->addField(‘multiline’, ‘multiline’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Multi Line’),
‘
class
’ => ‘required-entry’,
‘required’ =>
true
,
‘name’ => ‘title’,
‘onclick’ => “”,
‘onchange’ => “”,
‘style’ => “border:10px”,
‘value’ => ‘hello !!’,
‘disabled’ =>
false
,
‘readonly’ =>
true
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
12.Link 链接
1
2
3
4
5
6
7
|
$fieldset->addField(‘link’, ‘link’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Link’),
‘style’ => “”,
‘href’ => ‘www.excellencemagentoblog.com’,
‘value’ => ‘Magento Blog’,
‘after_element_html’ => ”
));
|
13.普通Label
1
2
3
|
$fieldset->addField(‘
label
’, ‘
label
’, array(
‘value’ => Mage::helper(‘form’)->__(‘Label Text’),
));
|
14.Image Upload图片上传
1
2
3
|
$fieldset->addField(‘image’, ‘image’, array(
‘value’ => ‘http:
//www.excellencemagentoblog.com/wp-content/themes/excelltheme/images/logo.png’,
));
|
15.File Upload文件上传
1
2
3
4
5
6
7
8
|
$fieldset->addField(‘file’, ‘file’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Upload’),
‘value’ => ‘Uplaod’,
‘disabled’ =>
false
,
‘readonly’ =>
true
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
16.日期Date
1
2
3
4
5
6
7
|
$fieldset->addField(‘date’, ‘date’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘
Date
’),
‘after_element_html’ => ”,
‘tabindex’ =>
1
,
‘image’ => $
this
->getSkinUrl(‘images/grid-cal.gif’),
‘format’ => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)
));
|
17.Checkbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
$fieldset->addField(‘checkbox’, ‘checkbox’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Checkbox’),
‘name’ => ‘Checkbox’,
‘checked’ =>
false
,
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
1
′,
‘disabled’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
$fieldset->addField(‘checkboxes’, ‘checkboxes’, array(
‘
label
’ => Mage::helper(‘form’)->__(‘Checkboxs’),
‘name’ => ‘Checkbox’,
‘values’ => array(
array(‘value’=>’
1
′,’
label
’=>’Checkbox1′),
array(‘value’=>’
2
′,’
label
’=>’Checkbox2′),
array(‘value’=>’
3
′,’
label
’=>’Checkbox3′),
),
‘onclick’ => “”,
‘onchange’ => “”,
‘value’ => ’
1
′,
‘disabled’ =>
false
,
‘after_element_html’ => ”,
‘tabindex’ =>
1
));
|
发表评论
-
Magento A-Z和sitemap插件
2012-09-30 11:53 3709Iifire历经四个月多开发 ... -
Magento SQL绑定查询条件
2012-04-17 15:17 2609Magento从数据库中取数据时大多用的Collection, ... -
Magento站内信插件
2012-02-28 10:04 1427Magento Message Box即站内信组件,主要用于管 ... -
Magento內链外链插件
2012-02-21 10:26 1427给您的Magento网站添加关键词的链接,更多的内链和外链,更 ... -
Magento高级产品订阅
2012-02-21 08:54 2239基本功能介绍 产品订 ... -
Magento产品降价通知和到货通知插件
2012-02-09 16:04 01.客户可以在Magento前台页面订阅某个产品的降价通知(缺 ... -
Magento学习课程继续
2011-03-20 16:05 1465由于前一大段时间都比较忙,忽略了大家啦,好久没有更新内容了。打 ... -
Magento在首页自定制Block的方法
2010-09-19 14:27 2804Magento中想在首页显示一些自定制的BLock有很多中方法 ... -
magento获取相应的查询语句
2010-09-19 14:12 1055虽然Magento对数据库层封装得比较深,但是我们可以很轻松的 ... -
Magento 使用小技巧体现大智慧(Last things first)
2010-06-15 23:38 1220在我们的购物车Magento上线之前,有些小细节很容易被忽略。 ... -
从数据库设计看Magento系列教程(1)
2010-06-15 19:11 0TODO..... -
Magento Events分析和使用实例与技巧
2010-06-14 20:15 3326当你需要扩展Magento的核心的功能时有两个选择 重写( ... -
Magento CMS 应用实例
2010-06-14 19:03 4767下面是一些CMS的应用实例: 本文已移到 http:// ... -
Magento 1.4.1.0 的CMS太酷了
2010-06-14 02:49 1671哇,Magento 1.4.1.0版本已经出来了,今天安装使用 ... -
Magento SEO 使用技巧
2010-06-13 20:50 1058这些内容大致分为: HTML Head URL rewr ... -
Magento web services API 扩展
2010-06-13 11:52 3085<?xml version="1.0&qu ... -
Magento image 操作
2010-06-13 10:48 1277由于lib/Varien/Image.php 的 Varie ... -
Magento中直接使用SQL查询语句
2010-06-13 10:29 1753本文已移到:http://www.iifire.com ... -
在导航栏中或其他位置添加Home链接
2010-06-13 08:47 2492本节不打算翻译,留给自己需要的时候Copy用 A ... -
Create Payment Method Module
2010-06-13 08:23 1145Javaeye的一些作者也有相 ...
相关推荐
Magento2的客户和地址表单字段经理 快速轻松地从管理员订单创建和客户帐户中删除不需要的表单字段,默认情况下是magento或其他第三方扩展添加的之后(创建管理订单)特征从以下内容中删除不需要的表单字段: 管理员...
NULL 博文链接:https://justcoding.iteye.com/blog/2100394
在 Magento Admin 中将任何 SQL 查询结果显示为网格和图表 在 Magento 1.9.x 上安装 使用安装: $ cd /path/to/magento $ modgit init $ modgit clone querygrid ...
Ajax-magento2-ajax-cart-quick.zip,magento 2 ajax购物车扩展插件提供舒适的购物体验。客户可以很容易地选择可配置的选项并在弹出窗口中编辑项目,而不会浪费重新加载页面的时间。,ajax代表异步javascript和xml。它...
这是零基础进入到magento开发最佳文档,吐血推荐,这些文档80% 都是自己实践 开发时 整理出来的 难免有些错误的地方,欢迎帮忙指出。
在Magento 1.7.x,1.8.x,1.9.x上安装使用安装: $ cd /path/to/magento$ modgit init$ modgit clone admin-theme https://github.com/jreinke/magento-admin-theme.git或手动下载软件包: 下载最新版本从管理员注销...
magento-admin-logger 来自 Miguel Balparda 的 Magento Admin Logger 这是 Magento Connect 上可用的模块。 我们将在这里维护它。 (Wagento)
magento数据结构分析 magento数据字典
Protect Magento instance admin from unexpected intrusions Set up newsletter and transactional emails so that communication from your website corresponds to the website’s look and feel Make the store ...
Magento2 ReIndex数据(Wbs_...安装扩展程序后,登录到您的Magento Admin Panel => System => Tools => Index Management 在此部分中,从操作下拉列表中选择“ ReIndex Data”。 有关Magento 2的更多文章和教程,请访
magik shoes magento 模板, magento 1.7 模板
magento的SMTP插件magento的SMTP插件magento的SMTP插件
Magento 表单填充程序这是 Firefox 的扩展,用于帮助使用测试数据填写 Magento 结帐和注册表单,在开发 Magento 站点时非常有用。 它带有一组可以从插件首选项自定义的虚拟数据这是 chrome 扩展的一个端口: : ...
该magento主题模板掺杂流行元素,清爽、美观,较适合做服装类网站。由kivin提供免费下载。注:欢迎到http://topmagento.com/ magento技术博客交流。那里还有几款漂亮的magento模板供大家免费下载。
深入理解Magento 由精东博客下载下来制作成pdf
NULL 博文链接:https://justcoding.iteye.com/blog/1886183
Magento插件开发手册 Magento Extension Developers Guide
Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全自定义,一键安装演示,小工具化横幅系统,颜色选择,MEGA菜单,多商店支持,自定义产品...
Magento Magento商城 Magento目录结构
magento2 developers cookbook, magento 开发手册,magento教程