Magento backend form element label 2--display date
Function introduction: Today I want to make a background form element to display the date and time. At first I thought it has the same function as the form element tag (1) used in the Magento background. I only need to set the type type to date, but after setting it, start I couldn't figure it out, so I thought about loading some js packages in the background and using external js plug-ins to implement this function. Later, I asked the company's technical expert and said that I can directly call the magento system's built-in one. Here is a record of how to achieve this. Function, the rendering is as follows:
The code is as follows, add the code in Form.php as follows:
<code>$fieldset->addField( 'endtime', 'date',//type类型 array( 'label' => Mage::helper('blog')->__('Endtime'), 'required' => true,//是否为必选项 'name' => 'endtime', 'image' => $this->getSkinUrl('images/grid-cal.gif'),//增加图标 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),//时间格式 ));</code>
Some additional notes:
1. Sometimes if you want to load some js in the background form, you can also add it in array() Add: 'after_element_html' => "".
2. To add css, you can first write the css style externally, $style="width:6px;text-align:center;" and then add: 'style'=> $style,//Define the css of the button. You can also write it directly, for example: 'style' => 'width:700px; height:500px;'.
<code>$fieldset->addField( 'endtime', 'date',//类型,可以为text,datetime,time,submit,select,radio,checkbox,password,link,label,image,file... array( 'label' => Mage::helper('blog')->__('Endtime'), 'required' => true,//是否为必选项 'style'=> $style,//定义按钮的css . 'name' => 'endtime', 'image' => $this->getSkinUrl('images/grid-cal.gif'),//添加图片 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'after_element_html' => "<script type='text/javascript'>//js代码</script>"。 ));</code>
The above introduces the Magento background form element tag 2-display date, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

Methods for element.style to modify elements: 1. Modify the background color of the element; 2. Modify the font size of the element; 3. Modify the border style of the element; 4. Modify the font style of the element; 5. Modify the horizontal alignment of the element. Detailed introduction: 1. Modify the background color of the element, the syntax is "document.getElementById("myElement").style.backgroundColor = "red";"; 2. Modify the font size of the element, etc.

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

The usage of the Type keyword in Go includes defining new type aliases or creating new structure types. Detailed introduction: 1. Type alias. Use the "type" keyword to create an alias for an existing type. This alias does not create a new type, but only provides a new name for the existing type. Type aliases can improve code. The readability of the code makes the code clearer; 2. Structure type. Use the "type" keyword to create a new structure type. The structure is a composite type that can be used to define custom types containing multiple fields. etc.

Methods for react to dynamically modify style: 1. Add ref to the element whose style needs to be modified, with syntax such as "<div className='scroll-title clear-fix' ref={ this.manage }>"; 2. Through dynamic control The change of state modifies the style of the element; 3. By using JS code in the DOM, the display and hiding transitions of different DOMs are realized.

An error occurs when ubuntu mounts a mobile hard disk: mount: unknownfilesystemtype'exfat'. The processing method is as follows: Ubuntu13.10 or install exfat-fuse: sudoapt-getinstallexfat-fuseUbuntu13.04 or below sudoapt-add-repositoryppa:relan/exfatsudoapt-getupdatesudoapt-getinstallfuse- exfatCentOS Linux mount exfat format USB disk error solution to load extfa in CentOS

New features of style Vue3.2 version has made many upgrades to the style of single-file components, such as local styles, css variables, and styles exposed to templates. (Learning video sharing: Vue video tutorial) 1. Local style When the label has scoped attribute, its CSS will only be applied to the elements of the current component: hi.example{color:red;} 2. The depth selector is scoped If the selector in the style wants to make a more "deep" selection, that is, affect sub-components, you can use the :deep() pseudo-class: .a:deep(.b){/*...*/ }DOM content created through v-html will not be

Part 1: Initial Troubleshooting Steps Checking Apple’s System Status: Before delving into complex solutions, let’s start with the basics. The problem may not lie with your device; Apple's servers may be down. Visit Apple's System Status page to see if the AppStore is working properly. If there's a problem, all you can do is wait for Apple to fix it. Check your internet connection: Make sure you have a stable internet connection as the "Unable to connect to AppStore" issue can sometimes be attributed to a poor connection. Try switching between Wi-Fi and mobile data or resetting network settings (General > Reset > Reset Network Settings > Settings). Update your iOS version:
