Skip to content

Commit

Permalink
Renamed the html helper class.
Browse files Browse the repository at this point in the history
  • Loading branch information
feuzeu committed Jan 8, 2025
1 parent 64ea46d commit a85ff29
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Jaxon\App\View;

/**
* AttrHelper.php
* HtmlAttrHelper.php
*
* Formatter for Jaxon custom HTML attributes.
*
Expand All @@ -29,7 +29,7 @@
use function json_encode;
use function trim;

class AttrHelper
class HtmlAttrHelper
{
/**
* @var string
Expand Down
12 changes: 6 additions & 6 deletions src/Di/Traits/ViewTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Jaxon\Plugin\Response\Dialog\Library\ModalInterface;
use Jaxon\Plugin\Response\Dialog\Library\QuestionInterface;
use Jaxon\App\I18n\Translator;
use Jaxon\App\View\AttrHelper;
use Jaxon\App\View\HtmlAttrHelper;
use Jaxon\App\View\TemplateView;
use Jaxon\App\View\ViewRenderer;
use Jaxon\Di\ClassContainer;
Expand Down Expand Up @@ -61,8 +61,8 @@ private function registerViews()
$this->val(AlertLibrary::class, new AlertLibrary());

// Helpers for HTML custom attributes formatting
$this->set(AttrHelper::class, function($di) {
return new AttrHelper($di->g(ClassContainer::class));
$this->set(HtmlAttrHelper::class, function($di) {
return new HtmlAttrHelper($di->g(ClassContainer::class));
});
}

Expand Down Expand Up @@ -175,10 +175,10 @@ public function getViewRenderer(): ViewRenderer
/**
* Get the custom attributes helper
*
* @return AttrHelper
* @return HtmlAttrHelper
*/
public function getCustomAttrHelper(): AttrHelper
public function getHtmlAttrHelper(): HtmlAttrHelper
{
return $this->g(AttrHelper::class);
return $this->g(HtmlAttrHelper::class);
}
}
8 changes: 4 additions & 4 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Jaxon;

use Jaxon\App\Ajax\Lib;
use Jaxon\App\View\AttrHelper;
use Jaxon\App\View\HtmlAttrHelper;
use Jaxon\Exception\SetupException;
use Jaxon\Script\Factory\ParameterFactory;
use Jaxon\Script\JqCall;
Expand Down Expand Up @@ -107,9 +107,9 @@ function jq(string $sPath = '', $xContext = null): JqCall
/**
* Get the custom attributes helper
*
* @return AttrHelper
* @return HtmlAttrHelper
*/
function attr(): AttrHelper
function attr(): HtmlAttrHelper
{
return jaxon()->di()->getCustomAttrHelper();
return jaxon()->di()->getHtmlAttrHelper();
}

0 comments on commit a85ff29

Please sign in to comment.