Template Wizard



( ZN >= 4.0.0 )

It was built to manipulate view files and to use simpler php commands. If the .wizard extension is added at the end of the views / display pages, such as test.wizard.php , this file can now be used with the methods described below. Each view page will be parsed with this wizard and converted to normal php code if you write it according to the rules of the template wizard . Now let's show you how to use this wizard. 

First of all you need to do is create a sample view file in Views / test.wizard.php .

 

 

# Section Headings


# Configuration ( ZN> = 4.6.0 )
# Special Characters

# Out-of-Purpose Exemplary
# Incorrect Use
# Correct Use

# P H Using the P Tag

# Isolation of real PHP tags

# Usage of Description Rows
# Printing Methods

# Two Brackets Notation
# Three Brackets Notation
# At and Two Point Notation
# Line Break  ( ZN> = 5.5.6 )
# N ul l Coalesce ( ZN> = 5.4.7 )

# Javascript Librarians Data Printing Usage ( ZN> = 5.2.75 )
# Usage of Cyclic and Decision Constructs ( ZN> = 3.1.0 )

# Foreach
# Forelse
# Loop
# For
# While
# If - Else If - Else

# HT M L Usage ( ZN> = 4.0.0 )

# Closed Labels
# Unclosed Labels

 

 

# Configuration ( ZN> = 4.6.0 )


You can set what should be translated in the Template wizard. You can turn things on and off that you do not want to be parse. This allows you to reduce the number of characters you will have to control at the same time.

File:  Config / ViewObjects.php
Wizard
Bool $ keywords = true Are the keywords translated? This value is true that the durumudnor , if , while , foreach can be parse.
Bool $ printable = true Can the writable functions and variables be used? This value is true if there @functio's :, @ $ variable : Allows the user.
Bool $ functions = true Can the Template Functions be used? Allows the use of @function : if this value is true .
Bool $ comments = true Can template comment lines be used? Allows the use of {- Comments -} if this value is true .
Bool $ tags = true Can template PHP tags be used? If this value is true then {[ $ code ; ]} .
Bool $ jsdata = true Vue , reactor is used as external JavaScript libraries used for data reception thereof { { data.ite I } } separator ZN wizard does not conflict with [{data.ite I}] allows to use form.
Bool $ html = false Can template HTML tags be used? This value is true if there #tag value ## tag allows private kulanımı like.

 

 

# Special Characters


In the Template wizard @ along with the sign : when used outside symbol objectives / it should be preceded by the symbol. If the use of the # character html is allowed in the configuration file, this character must also be escaped with the same symbol.

Exclusion of Purpose

The goal @phpcode:is similar to outsourcing , but in fact it should be preceded by the / symbol in cases where there is no code . Such an exception occurs especially in the code because of the same purpose of using the same characters.

Misuse
@Form::id('@data:')->text('example'):
< input type = "text" name = "example" value = "" id = " ">
Correct usage
@Form::id('/@data/:')->text('example'):
< input type = "text" name = "example" value = "" id = " @data:"

In such uses, you can think of the escaping of symbols as the case in string expressions .print('your\'s code')

 

 

# Using PHP Tags


On the Template view page, if needed, php tags can be used with alternative usage as follows .

{[ echo 'Hi, ZERONEED' ]}
< ? php echo 'Hi ZERONEED' ? >
( ZN FE 5.5.80 )

With this update, PHP tags can also be used as follows.

@php 
# your codes...
@endphp
Isolation of True P H P P

You can not use classic PHP tags in the template wizard . These tags are isolated. This can also cause your page not to produce the desired output. Isolation is done by converting the template wizard to PHP tags.

 

 

# Use of Description Rows


The following description can be used in the Template view page.

{-- Views/test.wizard.php --}
< ! - Views / test.wizard.php - >

 

 

# Printing Methods


On the template view page, printing can be performed as follows. Textual expressions can be used to print numbers, variables, or functions. String expressions must be enclosed in quotation marks.

Two Brackets Notation

The method to be printed is enclosed in either variable or fixed double brackets.

{{ $example }}
< ? php echo $ example ? >
Three Brackets Notation

The content of the command to be printed is rendered by printing the html and quotation marks to the numeric code.

{{{ $example }}}
< ? php echo htmlentities ( $ example ) ; ? >
Horse and Two Point Notation

The @ symbol for variable, method and constant to be printed is fetched . Finally, the : symbol is added. If the expression is the end of the end of the line is :  There is no need to use.

For variables;

@$example:
< ? php echo $ example ? >

For methods and functions;

@URL::base('example'):
< ? php echo URL::base( 'example' ) ? >

For stationary;

@CURRENT_CONTROLLER:
< ? php echo 'Home' ? >

used.

Line End ( ZN> = 5.5.6 )

If the end of the method or variable matches the end of the line : there is no need to use it.

@Import::script('jquery')
<title> $title </title>
@if( ! $value )
    @$value
@endif
N u ll Coalesce ( ZN> = 5.4.7 )

Unidentified or NULL is defined variable and constant undefined error received from the user is used to manipulate.

For variables;

@$varname?:

For stationary;

@CONST_NAME?:

used.

 

 

# Using Javascript Librarians to Print Data


Used in JavaScript libraries like Vue, React data since the use of the template will conflict with the use of the wizard for the writing of symbols [{ data }]form should be used. So for vue or angular data instead [{ data }]You should use. Of course, this is true if you have not changed the delimiter setting of the relevant JavaScript library.

Example Usage
<div id="app">[{message}]</div>

 

 

# Usage of Cycles and Decision Constructs ( ZN> = 3.1.0 )


You can use quite simple semi-structured shading and decision making in template construction.

updates

5.5.60 : The  use of the : symbolat the end of the loophas been removed.

foreach
@foreach( $data as $key => $val ):
    @$key: - @$val: {-- @$degiken: writable variable form --}
@endforeach:
Forelse ( ZN >= 5.4.4 )

Usage is the same as foreach . The only difference is that you can decide what to do if the parameter you enter into the loop is empty or undefined.

@forelse( $datas as $key => $value ):
    @$key: - @$value:
@empty:
    No Data
@endforelse:
Loop ( ZN >= 5.4.7 )

Usage is like foreach . The only difference is that $ key => $ value is not specified. This usage is predefined. So $ key and $ value can be used directly.

@loop($data):
    {{$key}} : {{$value}}
@endloop:
FR
@for($i = 0; $i < 10; $i++ ):
    @$i:
@endfor:
while
{[ $i = 0; ]}
@while( $i < 10 ):
    @$i:
    {[ $i++ ]} {-- {[ ]} PHP open close tags. --}
@endwhile:
In F - E l h I F - El p e
@if( 2 > 1 ):
    True
@elseif( 1 > 2 ):
    False
@else:
    Other
@endif:

 

 

# HT M L Usage ( ZN> = 4.0.0 )


The html tags can be used in the template view page as follows . For these uses, you need to set the html usage value to true from the above configuration file .

Closed Labels

There are a few alternative uses for closed labels.

#b ZN Framework ##b
< b > ZN Framework < / b >

Short Label

#b(ZN Framework):
< b > ZN Framework < / b >
#title(HTML Example):
< title > HTML Example < / title >
Note: Short tags have no nesting features.
Unclosed Tags

The use of unclosed tags is as follows.

#input[type="text" value="Value"]
< input type = "text" value = "Value">
#br
< Br >