Пример #1
0
<?php

use Maslosoft\Ilmatar\Widgets\Form\ActiveForm;
use Maslosoft\Ilmatar\Components\Controller;
use Faker\Factory as FF;
use Maslosoft\Zamm\Capture;
use Maslosoft\Zamm\Namer;
/* @var $this Controller */
/* @var $form ActiveForm */
?>

<title>Namer</title>
#Namer

Namer helps getting fully qualified names, which could be long, and tedious to repeatedly include in code.

To get class name, wrap it with namer and cast to string, optionally with [wrapper](../wrapper/):

<?php 
Capture::open();
echo (new Namer(Capture::class))->md;
echo Capture::close()->md;
Пример #2
0
?>
 or <?php 
echo $n->md->md;
?>
 indicator to selected Zamm method calls.
Alternativelly this can be invoked by appending method calls, respectivelly <?php 
echo $n->html()->md;
?>
 or <?php 
echo $n->md()->md;
?>
.
Wrapper type is defined by Zamm, so it is automatically selected according to context.
Generally, for names it is inline, for code fragments it is multiline.

Example usage of inline wrapper:

<?php 
Capture::open();
echo (new Namer(Capture::class))->html . PHP_EOL;
echo (new Namer(Capture::class))->md;
echo Capture::close()->md;
?>

Example usage of multiline wrapper:

<?php 
Capture::open();
echo (new Source(Wrapper::class))->html()->md;
echo Capture::close()->html;