- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
$a = token_get_all("<?php
class RegistrationFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', TextType::class, array('label' => 'form.username'))
;
}
}
");
foreach ($a as $t) {
if (isset($t[1])) {
echo token_name($t[0]), "\n";
} else {
echo $t, "\n";
}
}