定制 flsouto/httextar 二次开发

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

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

flsouto/httextar

Composer 安装命令:

composer require flsouto/httextar

包简介

Creates textarea fields

README 文档

README

Produces Textareas. This is an extension of the HtTextin class.

Installation

Run composer:

composer require flsouto/httextar

Usage

By default, the textar widget is rendered in writable mode. See example:

<?php
use FlSouto\HtTextar;
require_once('vendor/autoload.php');

$field = new HtTextar('description');
$field->context(['description'=>'This is a very long description']);

echo $field;

Outputs:

<div class="widget 589f96dbdf794" style="display:block">
 <textarea name="description" cols="40" rows="4">This is a very long description</textarea>
 <div style="color:yellow;background:red" class="error">
 </div>
</div>

Switch to Readonly

Use the readonly method to switch to readonly mode:

use FlSouto\HtTextar;
require_once('vendor/autoload.php');

$field = new HtTextar('description');
$field->readonly();
$field->context(['description'=>'This is a very long description']);

echo $field;

Outputs:

<div class="widget 589f96dbe11ec" style="display:block">
 <textarea name="description" cols="40" rows="4" readonly="readonly">This is a very long description</textarea>
 <div style="color:yellow;background:red" class="error">
 </div>
</div>

Setting dimensions of textarea

You can set the cols and rows attributes by using the respective methods:

use FlSouto\HtTextar;

$field = new HtTextar('description');
$field->cols(80)->rows(10);

echo $field;

Outputs:

<div class="widget 589f96dbe171b" style="display:block">
 <textarea name="description" cols="80" rows="10"></textarea>
 <div style="color:yellow;background:red" class="error">
 </div>
</div>

Notice: this is only a shortcut to calling $field->attrs(['cols'=>80,'rows'=>10])

Alternative syntax for setting dimensions

You can use the size method passing a string in the format "COLSxROWS" to set both dimensions in one go:

$field = new HtTextar('description');
$field->size('80x10');

echo $field;

Output:

<div class="widget 589f96dbe1c28" style="display:block">
 <textarea name="description" cols="80" rows="10"></textarea>
 <div style="color:yellow;background:red" class="error">
 </div>
</div>

To learn more about everything you can do with this widget, please refer to the following documentations:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固