Skip to content

Commit

Permalink
rename Text::addHtml method to stress safety
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Sep 7, 2023
1 parent ae5cd3b commit 0358f24
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demos/_includes/PromotionText.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function init(): void
Agile Toolkit base package includes:
EOF);

$t->addHtml(<<<'EOF'
$t->dangerouslyAddHtml(<<<'EOF'
<ul>
<li>Over 40 ready-to-use and nicely styled UI components</li>
<li>Over 10 ways to build interraction</li>
Expand Down
2 changes: 1 addition & 1 deletion demos/data-action/factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
]);
$msg->text->addParagraph('');

$msg->text->addHtml('Override Executor class may be applied globally, via the App instance like below, or per <a href="factory-view.php">View instance</a>.');
$msg->text->dangerouslyAddHtml('Override Executor class may be applied globally, via the App instance like below, or per <a href="factory-view.php">View instance</a>.');

$msg->text->addParagraph('In this example, Crud and Card button was changed and set through the App instance.');

Expand Down
2 changes: 1 addition & 1 deletion demos/form/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$view = new Message('Date field vs control:');
$view->setApp($form->getApp());
$view->invokeInit();
$view->text->addHtml($message);
$view->text->dangerouslyAddHtml($message);

return $view;
});
Expand Down
2 changes: 1 addition & 1 deletion demos/layout/layouts_manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
$app->initLayout([Layout::class]);

$layout->setApp($app);
Text::addTo($app->layout)->addHtml($layout->render());
Text::addTo($app->layout)->dangerouslyAddHtml($layout->render());
6 changes: 3 additions & 3 deletions demos/tutorial/intro.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$t->addParagraph(<<<'EOF'
Agile Toolkit is a "Low Code Framework" written in PHP. It is designed to simplify all aspects of web application creation:
EOF);
$t->addHtml(<<<'EOF'
$t->dangerouslyAddHtml(<<<'EOF'
<ul>
<li>No front-end coding necessary (like JavaScript)</li>
<li>No Database coding required (like SQL)</li>
Expand All @@ -39,7 +39,7 @@

$t->addParagraph('Your ATK code instead takes a more declarative approach. You work with things like:');

$t->addHtml(<<<'EOF'
$t->dangerouslyAddHtml(<<<'EOF'
<ul>
<li>Models and fields</li>
<li>Model User actions</li>
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function init(): void
$t->addParagraph(<<<'EOF'
This code shows you a combination of 3 objects:
EOF);
$t->addHtml(<<<'EOF'
$t->dangerouslyAddHtml(<<<'EOF'
<ul>
<li>Form - a generic view that can display and handle any form</li>
<li>Model - defines fields for a business object</li>
Expand Down
2 changes: 1 addition & 1 deletion src/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function addParagraph($text)
*
* @return $this
*/
public function addHtml(string $html)
public function dangerouslyAddHtml(string $html)
{
$this->content .= $html;

Expand Down

0 comments on commit 0358f24

Please sign in to comment.