HTML Library



( ZN >= 1.0.0 )

HTML elements in the form of the class by bringing the appearance of the controller is intended to use. This is useful when you need to use HTML code in a file with PHP -specific code . With object chaining, desired property value pairs can be easily added. Rather, it works integrated with Validation :: and Permission :: libraries.

 

 

# Methods


String element ( String $ element , String $ str = NULL , Array $ attr = [] )
String multiAttr ( String $ str , Array $ array = [] )
String heading ( String $ str , Int $ type = 3 , Array $ attr = [] )
String font ( String $ str , String $ size = NULL , String $ color = NULL , String $ face = NULL )
String Paragraph ( String $ str , Array $ array = [] )
String bold ( String $ str , Array $ array = [] )
String strong ( String $ str , Array $ array = [] )
String italic ( String $ str , Array $ array = [] )
String underLine ( String $ str , Array $ array = [] )
String overLine ( String $ str , Array $ array = [] )
String underText ( String $ str , Array $ array = [] )
String overText ( String $ str , Array $ array = [] )
String anchor ( String $ url , String $ value = NULL , Array $ attr = [] )
String mailTo ( String $ mail , String $ value = NULL , Array $ attr = [] )
String image ( String $ src , Int $ width = NULL , Int $ height = NULL , Array $ attr = [] )
String meta ( Mixed $ name , String $ content = NULL )
Object table ( Void )
Object list ( Void )
String form ( Void )
String label ( String $ for , String $ value = NULL , String $ form = NULL , Array $ attr = [] )
String space ( Int $ count = 4 )
String br ( Int $ count = 1 )
String audio ( String $ src , String $ content = NULL , Array $ attr = [] )
String video ( String $ src , String $ content = NULL , Array $ attr = [] )
String embed ( String $ src , Array $ attr = [] )
String source ( String $ src , Array $ attr = [] )
String canvas ( String $ src , Array $ attr = [] )
String aside ( String $ html )
String article ( String $ html )
String footer ( String $ html )
String header ( String $ html )
String nav ( String $ html )
String section ( String $ html )
String hgroup ( String $ html )
String command ( String $ content , Array $ attributes = [] )
String dataList ( String $ content , Array $ attributes = [] )
String details ( String $ content , Array $ attributes = [] )
String dialog ( String $ content , Array $ attributes = [] )
String figCaption ( String $ content , Array $ attributes = [] )
String figure ( String $ content , Array $ attributes = [] )
String keygen ( Array $ attributes = [] )
String mark ( String $ content , Array $ attributes = [] )
String meter ( String $ content , Array $ attributes = [] )
String time ( String $ content , Array $ attributes = [] )
String summary ( String $ content , Array $ attributes = [] )
String progress ( String $ content , Array $ attributes = [] )
String output ( String $ content , Array $ attributes = [] )

 

 

# Features


All HTMLproperties that apply to all form objects can be used with a method.

Html::alt('example')->style('red:color')-> - - -

The methods like alt () , style () used above are used to determine what constitutes the property value pair of the input object. This usage is common to all html elements. Every Html :: object can provide parameter usage with these optional methods besides its own parameters. If the property is composed of multiple words and a hyphen (-) between them , this property is used in the form camelCase ie exampleElement () .

 

 

# Element ( ZN >= 1.0.0 )


Used to implement any html format tag.

Parameters
String $ element Element.
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
\Output::writeLine( Html::element('u', 'Data') );
\Output::writeLine( Html::element('i', 'Data') );
\Output::writeLine( Html::element('strong', 'Data', ['id' => 'example']) );
<u>Metin</u>
<i>Metin</i>
<strong id="example">Data</strong>

 

 

# Multiattr ( ZN >= 1.0.2 )


The specified bank is used to apply more than one element at the same time.

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::multiAttr('Data', ['u' , 'i' , 'b']);
echo Html::multiAttr('Data', ['u' , 'i' => ['id' => 2]]);
<u><i><b>Data</b></i>u>
<u><i id="2">Data</i></u>

 

 

# Heading ( ZN >= 1.0.0 )


The use of the HTML tag. A text is used to organize as title information.<hx>

Parameters
String $ content Content.
Int $ type = 3 Title size type. 1 - 6
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::heading('Data');
echo Html::heading('Data', 1);
echo Html::heading('Data', 2, ['id' => 'example']);
<h3>Data</h3>
<h1>Data</h1>
<h2 id="example">Data</h2>

 

 

# Font ( ZN >= 1.0.0 )


The use of the HTML tag. Used to format font properties of text.<font>

Parameters
String $ content Content.
Int $ size = NULL Size.
String $ color = NULL Color.
String $ face = NULL Font.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::font('Data', 9, 'red', 'tahoma');
<font size="9" color="red" face="tahoma">Data</font>

 

 

# Parag ( ZN >= 1.0.0 )


The use of the HTML tag. The paragraph is used to make head.<p>

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::parag('Metin', ['style' => 'color:red']);
<p style="color:red">Data</p>

 

 

# Bold ( ZN >= 1.0.0 ) /Strong ( ZN >= 1.0.8 )


The use of the HTML tag. Used for writing .<b>koyu yazmak

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::bold('Data');
echo Html::strong('Data');
<b>Data</b>
<strong>Data</strong>

 

 

# Italic ( ZN >= 1.0.0 )


The use of the HTML tag. is used to write.<em>Eğik yazı

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::italic('Data');
<em>Data</em>

 

 

# UnderLine ( ZN >= 1.0.0 )


The use of the HTML tag. is used to write.<u>Altı çizgili

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::underline('Data');
<u>Data</u>

 

 

# OverLine ( ZN >= 1.0.0 )


The use of the HTML tag. used to write<del>Ortası çizili

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::overline('Data');
<del>Data</del>

 

 

# UnderText ( ZN >= 1.0.0 )


The use of the HTML tag. is used to write.<u>Tabana yazı

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo '10'.Html::undertext('2');
10<sub>2</sub>

 

 

# OverText ( ZN >= 1.0.0 )


The use of the HTML tag. is used to write.<sup>Üste yazı

Parameters
String $ content Content.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo '10'.Html::overtext('2');
10<sup>2</sup>

 

 

# Anchor ( ZN >= 1.0.0 )


The use of the HTML tag. .<a>Link

Parameters
String $ url URLs
String $ Value Display name. If this parameter is null, it takes 1 as . parametrevalue.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::anchor('https://example.xxx', 'Example');
echo Html::anchor('https://example.xxx');
<a href="https://example.xxx">Example</a>
<a href="https://example.xxx">https://example.xxx</a>

 

 

# MailTo ( ZN> = 1.0.0 )


The use of the HTML tag. .<a mailto:>Link

Parameters
String $ url URLs
String $ Value Display name. If this parameter is null, it takes 1 as . parametrevalue.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::mailTo('robot@znframework.com', 'Robot');
echo Html::mailTo('robot@znframework.com');
<a href="mailto:robot@znframework.com">Robot</a>
<a href="mailto:robot@znframework.com">robot@znframework.com</a>

 

 

# Image ( ZN >= 1.0.0 )


The use of the HTML tag. to create impressions.<img>Resim

Parameters
String $ url URL.
Int $ width Width.
Int $ height Height.
Array $ attributes = NULL Property value pairs.
return String
Use of
echo Html::image('image/example.jpg', 200, 200);
<img src="https://localhost/zeroneed/image/example.jpg" width="200" height="200" title="" alt="">

 

 

# Meta ( ZN >= 1.0.0 )


The use of the HTML tag. Used to create meta tags. The first parameter can contain data of type string or array . If multiple meta tags are used, the first parameter is used in the array type.<meta>

Parameters
Mixed $ type = 'name' name or http .
Array $ attributes = NULL Property value pairs.
return String
Examples
echo Html::meta('name:author', 'Ozan UYKUN');
echo Html::meta('http:refresh', 5);
<meta name="author" content="Ozan UYKUN" />
<meta http-equiv="refresh" content="5" />
Multiple Meta Use

For multi-meta usage, it is used as follows.

echo Html::meta
([
    'http:refresh' => 5,
    'name:author'  => 'Ozan UYKUN',
    'description'  => 'Meta Example'
]);
<meta http-equiv="refresh" content="5" />
<meta name="author" content="Ozan UYKUN" />
<meta name="description" content="Meta Example" />

If the key words, name:or http:the prefix, are not specified, name:the prefix is ​​assumed to be present.

 

 

# Table ( ZN >= 4.0.23 )


TheTable table created with classbefore v.4.0.2 3 is nowavailable with the Html library.

Parameters
void
return Object
Optional Methods
this attr ( Array $ attributes )
this cell ( Int $ spacing , Int $ padding )
this border ( Int $ border , String $ color = NULL )
this size ( Int $ width , Int $ height )
this style ( Array $ attributes )

And other table properties.

Use of
echo Html::table()
         ->border(1)
         ->borderColor('red')
         ->create
         (
             [1, 2, 3, 4],
             ['a', 'b' => ['colspan' => 3]]
         );
<table border="1" bordercolor="red">
<tr>
  <td>1</td>
  <td>2</td>
  <td>3</td>
  <td>4</td>
</tr>
    <tr>
  <td>a</td>
  <td colspan="2">b</td>
</tr>
</table>

 

 

# List ( ZN >= 4.0.23 )


TheSchedule list created with classbefore v.4.0.2 3 is nowavailable with the Html library.

Parameters
void
return Object
Use of
echo Html::list()->create
([
    'ul type="square"' =>
    [
        'Paris',
        'Londra',
        'Istanbul' =>
        [
            'ol' => ['Sultan Ahmet', 'Emin Onu']
        ]
    ]
]);
<ul type="square">
<li>Paris</li>
<li>Londra</li>
<li>Istanbul
  <ol>
   <li>Sultan Ahmet</li>
   <li>Emin Onu</li>
  </ol>
</li>
</ul>

 

 

# Form ( ZN >= 4.0.23 )


FormFormis identical to the use of the library because it references the library.

Parameters
void
return Object
Examples
echo Html::form()->placeholder('Hi')->text('hi');
<input type="text" name="hi" value="" placeholder="Hi">