定制 waughj/html-select 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

waughj/html-select

Composer 安装命令:

composer require waughj/html-select

包简介

Simple class for easily generating select tags.

README 文档

README

Simple class for easily generating select tags.

1st argument is an array of options, which can either be associative or linear. Associative will use the key as the value attribute & value as the name, linear will use the index as the value attribute & the value as the name. If it’s an array of arrays, then it will check to see if that array has “value” & “name” keys & try to use the values of those. To set an option as selected, add a key “selected” with the value true.

The 2nd argument is an associative list of attributes for the select tag.

Example

use WaughJ\HTMLSelect\HTMLSelect;

echo new HTMLSelect
(
    [
        [ 'value' => 'one', 'name' => 'One' ],
        [ 'value' => 'two', 'name' => 'Two', 'selected' => true ],
        [ 'value' => 'three', 'name' => 'Three', ]
    ],
    [ 'class' => 'select', 'id' => 'select-1' ]
);

Will output:

<select class="select" id="select-1">
    <option value="one">One</option>
    <option value="two" selected="selected">Two</option>
    <option value="three">Three</option>
</select>

Changelog

0.1.0

  • Initial release

统计信息

  • 总下载量: 30
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2019-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固