Component Builder (v.5.0.0-alpha1)
+ Component Builder (v.5.0.0-alpha2)
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 4562db26e..b102315ca 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -5,10 +5,10 @@
pkg_component_builder
package
site
- 3.2.0-beta4
+ 3.2.0-beta6
https://dev.vdm.io
- https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta4.zip
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta6.zip
beta
@@ -23,10 +23,10 @@
pkg_component_builder
package
site
- 4.0.0-alpha1
+ 4.0.0-alpha2
https://dev.vdm.io
- https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-alpha1.zip
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-alpha2.zip
stable
@@ -53,4 +53,22 @@
https://dev.vdm.io
+
+ Component Builder
+ Builds Complex Joomla Components
+ pkg_component_builder
+ package
+ site
+ 5.0.0-alpha2
+ https://dev.vdm.io
+
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-alpha1.zip
+
+
+ beta
+
+ Llewellyn van der Merwe
+ https://dev.vdm.io
+
+
\ No newline at end of file
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php
index b987c521a..e762fed9b 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php
@@ -17,6 +17,7 @@ use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
+use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
@@ -117,6 +118,12 @@ final class Placeholder implements PlaceholderInterface
$bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')];
$bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix;
$bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')];
+ $bucket[Placefix::_h('ComponentNamespace')] = NamespaceHelper::safeSegment(StringHelper::safe($config->component_code_name, 'F'));
+ $bucket[Placefix::_('ComponentNamespace')] = $bucket[Placefix::_h('ComponentNamespace')];
+ $bucket[Placefix::_h('NamespacePrefix')] = $config->namespace_prefix;
+ $bucket[Placefix::_('NamespacePrefix')] = $config->namespace_prefix;
+ $bucket[Placefix::_h('NAMESPACEPREFIX')] = $config->namespace_prefix;
+ $bucket[Placefix::_('NAMESPACEPREFIX')] = $config->namespace_prefix;
// get the current components overrides
if (($_placeholders = GetHelper::var(
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php
index b93f4750d..6b24caf32 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php
@@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/
public function get(object $extension): string
{
+ // purge the object
+ $this->rest();
+
// loop over methods and types
foreach ($this->methods as $method)
{
@@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build();
}
+ /**
+ * Reset all bucket at the start of each build
+ *
+ * @return void
+ * @since 3.2.0
+ */
+ protected function rest(): void
+ {
+ $this->construct = [];
+ $this->install = [];
+ $this->update = [];
+ $this->uninstall = [];
+ $this->preflightActive = false;
+ $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ $this->postflightActive = false;
+ $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ }
+
/**
* build the install class
*
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php
index ce1d45be7..a9acfa5d4 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php
@@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/
public function get(object $extension): string
{
+ // purge the object
+ $this->rest();
+
// loop over methods and types
foreach ($this->methods as $method)
{
@@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build();
}
+ /**
+ * Reset all bucket at the start of each build
+ *
+ * @return void
+ * @since 3.2.0
+ */
+ protected function rest(): void
+ {
+ $this->construct = [];
+ $this->install = [];
+ $this->update = [];
+ $this->uninstall = [];
+ $this->preflightActive = false;
+ $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ $this->postflightActive = false;
+ $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ }
+
/**
* build the install class
*
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php
index 04a820576..c36a36bee 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php
@@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/
public function get(object $extension): string
{
+ // purge the object
+ $this->rest();
+
// loop over methods and types
foreach ($this->methods as $method)
{
@@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build();
}
+ /**
+ * Reset all bucket at the start of each build
+ *
+ * @return void
+ * @since 3.2.0
+ */
+ protected function rest(): void
+ {
+ $this->construct = [];
+ $this->install = [];
+ $this->update = [];
+ $this->uninstall = [];
+ $this->preflightActive = false;
+ $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ $this->postflightActive = false;
+ $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
+ }
+
/**
* build the install class
*
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php
index 8d32386c1..a4bd0ee88 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php
@@ -101,9 +101,9 @@ class Infusion extends Interpretation
CFactory::_('Placeholder')->get('component')
);
- // ComponentNameSpace
- CFactory::_('Compiler.Builder.Content.One')->set('ComponentNameSpace',
- NamespaceHelper::safeSegment(CFactory::_('Placeholder')->get('Component'))
+ // ComponentNamespace
+ CFactory::_('Compiler.Builder.Content.One')->set('ComponentNamespace',
+ CFactory::_('Placeholder')->get('ComponentNamespace')
);
// COMPANYNAME
@@ -197,7 +197,7 @@ class Infusion extends Interpretation
// set the namespace prefix
CFactory::_('Compiler.Builder.Content.One')->set('NAMESPACEPREFIX',
- CFactory::_('Config')->namespace_prefix
+ CFactory::_('Placeholder')->get('NAMESPACEPREFIX')
);
// set the global version in case
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php
index 1fffe1db4..b065c863a 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php
@@ -2274,11 +2274,11 @@ class Interpretation extends Fields
{
$xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Rule"';
$xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Field">';
}
@@ -2331,11 +2331,11 @@ class Interpretation extends Fields
{
$xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Rule"';
$xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Field">';
}
$xml .= implode(Indent::_(3), $params);
@@ -8918,7 +8918,7 @@ class Interpretation extends Fields
// set the table
$array['table'] = '{"special": {"dbtable": "#__' . $component . '_'
. $view . '","key": "id","type": "' . $View . 'Table","prefix": "' . CFactory::_('Config')->namespace_prefix
- . '\\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\Administrator\\Table"}}';
// set rules field
@@ -23182,11 +23182,11 @@ class Interpretation extends Fields
{
$xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Rule"';
$xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Field">';
}
$xml .= PHP_EOL . Indent::_(1) . '>';
@@ -23585,11 +23585,11 @@ class Interpretation extends Fields
{
$xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Rule"';
$xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
- . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace')
+ . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Field">';
}
$xml .= PHP_EOL . Indent::_(1) . '>';
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
index 245cf05d9..232fb6221 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
@@ -26,13 +26,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
class Event implements EventInterface
{
/**
- * event plugin trigger switch
+ * event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
+ /**
+ * The application to trigger and event TODO
+ *
+ * @since 3.2.0
+ */
+ protected $dispatcher;
+
/**
* Constructor
*
@@ -60,6 +67,8 @@ class Event implements EventInterface
}
}
}
+
+ $this->dispatcher = Factory::getApplication();
}
/**
@@ -77,22 +86,14 @@ class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
- // Get the dispatcher.
- $dispatcher = \JEventDispatcher::getInstance();
-
- // Trigger this compiler event.
- $results = $dispatcher->trigger($event, $data);
-
- // Check for errors encountered while trigger the event
- if (count((array) $results) && in_array(false, $results, true))
+ try
{
- // Get the last error.
- $error = $dispatcher->getError();
-
- if (!($error instanceof \Exception))
- {
- throw new \Exception($error);
- }
+ // Trigger this compiler event.
+ $results = $this->dispatcher->triggerEvent($event, $data ?? []);
+ }
+ catch (\Exception $e)
+ {
+ throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php
index cd95b8476..5db107120 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php
@@ -22,7 +22,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
-use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
@@ -145,7 +144,7 @@ final class Header implements HeaderInterface
* @var string
* @since 3.2.0
*/
- protected string $ComponentNameSpace;
+ protected string $ComponentNamespace;
/**
* Constructor.
@@ -181,9 +180,9 @@ final class Header implements HeaderInterface
$this->tags = $tags;
// set some global values
- $this->NamespacePrefix = $this->config->get('namespace_prefix');
+ $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component');
- $this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
+ $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
}
/**
@@ -209,7 +208,7 @@ final class Header implements HeaderInterface
$target = 'Site';
}
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed
switch ($context)
@@ -218,7 +217,7 @@ final class Header implements HeaderInterface
case 'site.views.model':
case 'site.view.html':
case 'site.views.html':
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\RouteHelper;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break;
default:
@@ -387,7 +386,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break;
case 'custom.admin.view.html':
@@ -404,7 +403,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break;
case 'admin.view.model':
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
index d15c3292d..578f5f651 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
@@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
+use Joomla\CMS\Factory;
use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper;
use VDM\Joomla\Utilities\Component\Helper;
@@ -26,13 +27,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
final class Event implements EventInterface
{
/**
- * event plugin trigger switch
+ * event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
+ /**
+ * The application to trigger and event TODO
+ *
+ * @since 3.2.0
+ */
+ protected $dispatcher;
+
/**
* Constructor
*
@@ -60,6 +68,8 @@ final class Event implements EventInterface
}
}
}
+
+ $this->dispatcher = Factory::getApplication();
}
/**
@@ -77,22 +87,14 @@ final class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
- // Get the dispatcher.
- $dispatcher = \JEventDispatcher::getInstance();
-
- // Trigger this compiler event.
- $results = $dispatcher->trigger($event, $data);
-
- // Check for errors encountered while trigger the event
- if (count((array) $results) && in_array(false, $results, true))
+ try
{
- // Get the last error.
- $error = $dispatcher->getError();
-
- if (!($error instanceof \Exception))
- {
- throw new \Exception($error);
- }
+ // Trigger this compiler event.
+ $results = $this->dispatcher->triggerEvent($event, $data ?? []);
+ }
+ catch (\Exception $e)
+ {
+ throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php
index a187c5718..712242b7e 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php
@@ -22,7 +22,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
-use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
@@ -145,7 +144,7 @@ final class Header implements HeaderInterface
* @var string
* @since 3.2.0
*/
- protected string $ComponentNameSpace;
+ protected string $ComponentNamespace;
/**
* Constructor.
@@ -181,9 +180,9 @@ final class Header implements HeaderInterface
$this->tags = $tags;
// set some global values
- $this->NamespacePrefix = $this->config->get('namespace_prefix');
+ $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component');
- $this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
+ $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
}
/**
@@ -209,7 +208,7 @@ final class Header implements HeaderInterface
$target = 'Site';
}
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed
switch ($context)
@@ -218,7 +217,7 @@ final class Header implements HeaderInterface
case 'site.views.model':
case 'site.view.html':
case 'site.views.html':
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\RouteHelper;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break;
default:
@@ -387,7 +386,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break;
case 'custom.admin.view.html':
@@ -404,7 +403,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
- $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;";
+ $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break;
case 'admin.view.model':