php 物品清单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 物品清单相关的知识,希望对你有一定的参考价值。

<h3>Example of using #theme</h3>
<ul>
  <li>Simple string</li>
  <li>Simple <span>#markup</span> string</li>
  <li class="custom-item-class">Custom item</li>
  <li>Parent item
    <ul>
      <li>Simple string child</li>
      <li class="custom-child-item-class">Second child item with custom attributes</li>
    </ul>
  </li>
</ul>
$items = array();
// A simple string item.
$items[] = 'Simple string';

// A simple string item as render array.
$items[] = [
  '#markup' => 'Simple <span>#markup</span> string',
];

// Set custom attributes for a list item.
$items[] = [
  '#markup' => 'Custom item',
  '#wrapper_attributes' => array(
    'class' => array('custom-item-class'),
  ),
];

// An item with a nested list.
$items[] = [
  '#markup' => 'Parent item',
  'children' => [
    'Simple string child',
    [
      '#markup' => 'Second child item with custom attributes',
      '#wrapper_attributes' => [
        'class' => array('custom-child-item-class'),
      ],
    ],
  ],
];

$build['list'] = [
  '#theme' => 'item_list',
  '#items' => [
    $this->t('This is some text that should be put in a list'),
    $this->t('This is some more text that we need in the list'),
  ],
];

$build['theme_element'] = [
  '#theme' => 'item_list',
  '#title' => $this->t('Example of using #theme item_list'),
  '#items' => $items,
];

以上是关于php 物品清单的主要内容,如果未能解决你的问题,请参考以下文章

出差必备物品清单15条

分栏报表-物品清单报表实现

备忘(自用,没啥价值,莫看)算法比赛物品清单及注意事项

葡萄城报表之分栏报表-物品清单报表实现

Leetcode 638.大礼包

[Leetcode]638. Shopping Offers