Skip to content

Commit

Permalink
Merge pull request #338 from robbiejackson/fix-app-code-error
Browse files Browse the repository at this point in the history
fixed link getting the Document via ->app instead of
  • Loading branch information
robbiejackson authored Nov 21, 2024
2 parents d2cbc83 + b231516 commit 552edb7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Our updated tmpl file is:
defined('_JEXEC') or die;

// highlight-start
$document = $app->getDocument();
$document = $this->app->getDocument();
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('mod_hello');
$wa->useScript('mod_hello.add-suffix');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Our updated tmpl file is:
defined('_JEXEC') or die;

// highlight-start
$document = $app->getDocument();
$document = $this->app->getDocument();
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('mod_hello');
$wa->useScript('mod_hello.add-suffix');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Our updated tmpl file is:
defined('_JEXEC') or die;

// highlight-start
$document = $app->getDocument();
$document = $this->app->getDocument();
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('mod_hello');
$wa->useScript('mod_hello.add-suffix');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The Web Asset Manager doesn't automatically read the joomla.asset.json files of
Then we need to tell it that we want to use the "mod_hello.add-suffix" asset, so that our js file gets included in the HTTP response:

```php
$document = $app->getDocument();
$document = $this->app->getDocument();
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('mod_hello');
$wa->useScript('mod_hello.add-suffix');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The Web Asset Manager doesn't automatically read the joomla.asset.json files of
Then we need to tell it that we want to use the "mod_hello.add-suffix" asset, so that our js file gets included in the HTTP response:

```php
$document = $app->getDocument();
$document = $this->app->getDocument();
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('mod_hello');
$wa->useScript('mod_hello.add-suffix');
Expand Down

0 comments on commit 552edb7

Please sign in to comment.