14
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Smarty の多次元配列の繰り返し処理

Last updated at Posted at 2013-06-18

意外とハマったSmartyで3次元配列の繰り返し処理

配列サンプル
array
  0 => 
    array
      0 =>
        array
          'id'   => '1'
          'name' => '田中'
      1 =>
          'id'   => '2'
          'name' => '鈴木'
TPL側繰り返し処理
{section name=item loop=$arrayData}
  {section name=unit loop=$arrayData[item]}
    {$arrayData[item][unit].id}
    {$arrayData[item][unit].name}
  {/section}
{/section}
14
10
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?