承接 phacil/html 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phacil/html

Composer 安装命令:

composer require phacil/html

包简介

Phacil PHP Framework HTML Classes

README 文档

README

HTML class is a component of Phacil PHP Framework

Instalation

Download zip from https://github.com/phacil/html, unzip file and use composer update inside folder

Now you can use the static methods to write HTML tags and its attributes in chain mode.

Loading HTML Class

<?php
include 'vendor/autoload.php';
use Phacil\Component\HTML\HTML;

Writing Elements

/* You can echo this code */
echo HTML::h1('This is a title');
/* or call output() function */
HTML::h2('This is a second title')->output();
/* and use chain mode to set attributes */
echo HTML::a('A link to google.com')->href('http:://google.com.br')->class('link');

Start a block

echo HTML::begin('div')->class('block')->id('content');
echo HTML::p(There is some content);
echo HTML::end('div');
/* or */
echo HTML::div(function(){
	echo HTML::p(There is some content);
})->class('block')->id('content');
/* or */	
echo HTML::div([
 	HTML::p(There is some content),
HTML::p(Another content)
]);

Especial Tags Function

You can write any tag with same structure shown above, except these guys:

/* Let's use this list */
$list = ["1"=>"First","Second","Third"];

Select

echo HTML::select($list, "2", $empty="Position")->id("select")->name("select");

Radio

echo HTML::radio($list, "2")->id("radios")->name("radios")->class("hotizontal");

Checkbox

echo HTML::checkbox($list, ["1" , "2"])->id("checkbox")->name("checkbox")->class("hotizontal");

Style

Now, we gonna write some CSS. This code:

$style = ['.btn-group' => [
               ' .btn'=> [                    
                        'color'=>'#ccc',
                        'padding'=>'0',
                        '.primary'=>[
                                    'color'=>'#08c',
                                    '.active'=>['color'=>'#08c'],
                        ],
                        '.danger'=>['color'=>'#F66']
                ],
            ],
        ];
echo HTML::style($style)

Out this:

<style>
     .btn-group{
      }
     .btn-group .btn{
          color:#ccc;
          padding:0;
      }
     .btn-group .btn.primary{
          color:#08c;
      }
     .btn-group .btn.primary.active{
          color:#081;
      }
     .btn-group .btn.danger{
          color:#08c;
      }
</style>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固