Skip to content

Instantly share code, notes, and snippets.

@harikt
Last active January 4, 2016 01:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save harikt/8551536 to your computer and use it in GitHub Desktop.
Aura.Html integration with Aura.View. Without di and with di. Need to convert the input also to di
<?php
$di->params['Aura\Html\HelperLocator']['helper_factory'] = $di->lazyNew('Aura\Html\HelperFactory');
$di->params['Aura\Html\HelperFactory']['escaper'] = $di->lazyNew('Aura\Html\Escaper');
$di->setter['Aura\Html\Helper\Input']['setHelperLocator'] = $di->lazyNew('Aura\Html\HelperLocator');
$di->params['Aura\Html\HelperFactory']['registry'] = array(
'anchor' => $di->lazyNew('Aura\Html\Helper\Anchor'),
'attr' => $di->lazyNew('Aura\Html\Helper\EscapeAttr'),
'base' => $di->lazyNew('Aura\Html\Helper\Base'),
'form' => $di->lazyNew('Aura\Html\Helper\Form'),
'escapeHtml' => $di->lazyNew('Aura\Html\Helper\EscapeHtml'),
'img' => $di->lazyNew('Aura\Html\Helper\Img'),
'button' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'checkbox' => $di->lazyNew('Aura\Html\Helper\Input\Checkbox'),
'color' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'date' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'datetime' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'datetime-local' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'email' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'file' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'hidden' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'image' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'month' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'number' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'password' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'radio' => $di->lazyNew('Aura\Html\Helper\Input\Radio'),
'range' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'reset' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'search' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'select' => $di->lazyNew('Aura\Html\Helper\Input\Select'),
'submit' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'tel' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'text' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'textarea' => $di->lazyNew('Aura\Html\Helper\Input\Textarea'),
'time' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'url' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'week' => $di->lazyNew('Aura\Html\Helper\Input\Generic'),
'input' => $di->lazyNew('Aura\Html\Helper\Input'),
'links' => $di->lazyNew('Aura\Html\Helper\Links'),
'metas' => $di->lazyNew('Aura\Html\Helper\Metas'),
'ol' => $di->lazyNew('Aura\Html\Helper\Ol'),
'scripts' => $di->lazyNew('Aura\Html\Helper\Scripts'),
'scriptsFoot' => $di->lazyNew('Aura\Html\Helper\Scripts'),
'styles' => $di->lazyNew('Aura\Html\Helper\Styles'),
'tag' => $di->lazyNew('Aura\Html\Helper\Tag'),
'title' => $di->lazyNew('Aura\Html\Helper\Title'),
'ul' => $di->lazyNew('Aura\Html\Helper\Ul'),
);
<?php
namespace Aura\Html;
include dirname(__DIR__) . '/autoload.php';
return new HelperLocator(new HelperFactory(
new Escaper,
array(
'anchor' => function () { return new Helper\Anchor; },
'attr' => function () { return new Helper\EscapeAttr; },
'base' => function () { return new Helper\Base; },
'form' => function () { return new Helper\Form; },
'escapeHtml' => function () { return new Helper\EscapeHtml; },
'input' => function () {
$helper_locator = new HelperLocator(new HelperFactory(
new Escaper,
array(
'button' => function () { return new Generic; },
'checkbox' => function () { return new Checkbox; },
'color' => function () { return new Generic; },
'date' => function () { return new Generic; },
'datetime' => function () { return new Generic; },
'datetime-local' => function () { return new Generic; },
'email' => function () { return new Generic; },
'file' => function () { return new Generic; },
'hidden' => function () { return new Generic; },
'image' => function () { return new Generic; },
'month' => function () { return new Generic; },
'number' => function () { return new Generic; },
'password' => function () { return new Generic; },
'radio' => function () { return new Radio; },
'range' => function () { return new Generic; },
'reset' => function () { return new Generic; },
'search' => function () { return new Generic; },
'select' => function () { return new Select; },
'submit' => function () { return new Generic; },
'tel' => function () { return new Generic; },
'text' => function () { return new Generic; },
'textarea' => function () { return new Textarea; },
'time' => function () { return new Generic; },
'url' => function () { return new Generic; },
'week' => function () { return new Generic; },
)
));
$input = new Helper\Input;
$input->setHelperLocator($helper_locator);
return $input;
},
'img' => function () { return new Helper\Img; },
'links' => function () { return new Helper\Links; },
'metas' => function () { return new Helper\Metas; },
'ol' => function () { return new Helper\Ol; },
'scripts' => function () { return new Helper\Scripts; },
'scriptsFoot' => function () { return new Helper\Scripts; },
'styles' => function () { return new Helper\Styles; },
'tag' => function () { return new Helper\Tag; },
'title' => function () { return new Helper\Title; },
'ul' => function () { return new Helper\Ul; },
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment