1104 resolves an issue related to array delivery in the Ecos pendant.

Source: Internet
Author: User

1. Pendant overview:

Pendant composition: _config.html background configuration, that is, the pop-up box when the point is added.

default.html Front desk display, that is, the page displayed at the front desk.

widget.php set the basic information for the pendant. 、

Theme_widget_testbrand template comes with a pendant. Widget_xxx System-Level Pendant

Widget.php have $setting can be passed to _config.html._config.html $setting can also be modified in Theme_widget_testbrand, return $setting/$ Data. The associated $data./$setting can also be obtained in the default.html.

---------------------------

2. Question: How to loop Save the address, title, and link of 12 images in the Branding pendant list.

_config.html:

<{foreach from= $setting. Brand Key=key item=item}>
<tbody>
<tr>
<th><{t app= ' consumer '}> pictures <{$key}>:<{/t}></th>
<td>
<input name= ' ad_pic[<{$key}>][pic_path] ' class= ' imgsrc ' id= ' ad_pic<{$key}> ' value= ' <{$setting. Ad _pic.key.pic_path}> ">
<input Type=button value= "<{t app= ' consumer '}> upload pictures <{/t}>" class= "uploadbtn" onclick= "Addpic (<{$key} >) ">
</td>
<td><{t app= ' consumer '}> picture title: <{/t}><input type= "text" name= "ad_pic[<{$key}>][pic_name]" Value= "<{$setting. Ad_pic. $key .pic_name}>" ></td>
<td><{t app= ' consumer '}> image link: <{/t}><input type= "text" name= "ad_pic[<{$key}>][pic_url]" value = "<{$setting. Ad_pic. $key .pic_url}>" ></td>
</tr>
</tbody>
<{/foreach}>

This can be saved. Save it in the form of an array. (Auto-Save) as brand can be defined again in widget.php.

Print it out in the Theme_widget_testbrand.

If so, it is this setting.

In Theme_widget_testbrand, print the following code: echo "<pre>"; Print_r ($setting);d ie;

In default.html:

<{foreach from= $setting. Ad_pic item=item key=key}>
<{if $key ==0}>
<{$item .pic_path}>
<{/if}>
<{if $key ==1}>
----------------<{$item .pic_name}>
<{/if}>
<{/foreach}>

The results can be seen:

Front is the address, followed by the title name.

has been successful.

------------------------------------------------------------------------

3. Problem: Convert $arr to $ARR2.

$arr =array (' a0 ' = ' aaa ', ' B0 ' and ' BBB ', ' c0 ' = ' CCC ', ' A1 ' + ' aaa ', ' B1 ' + ' BBB ', ' c1 ' = ' CCC ');
$arr 2 = Array (' 0 ' =>array (' a0 ' = ' + ' aaa ', ' b0 ' = ' bbb ', ' c0 ' = ' CCC '), ' 1 ' =>array (' a1 ' = ' aaa ', ' b1 ' = ' BBB ', ' c1 ' = ' CCC ');
echo "<pre>";
Print_r (Array_chunk ($arr, 3));

------------------------------------------------------------------------

4. Related to picture upload problem, can refer to: Pendant: ad_pic.pic_6.slideshow.

1104 resolves an issue related to array delivery in the Ecos pendant.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.