adding Joomla\CMS\Filesystem\File #1166
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1166
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As I wrote on telegram:
'I'm struggling with the differences between J3 and J4 code. I couldn't figure out where and how to integrate the Joomla file system in my admin view (use Joomla\CMS\Filesystem\File). Unfortunately, the old YT tutorials are no longer helpful.'
You guidance how to do this with the new Joomla Power feature is much appreciated.
In what area of the admin view would you like this? Would be the first question... so if you can give use a screenshot of where you would like to add our custom code?
That is still the same between all versions of Joomla... and JCB, and so for that the tutorials will still give you all the information you need.
Once we know where, as in what area you want to add your
Joomla\CMS\Filesystem\File
code... you then must just use the JPK key in this way.Replace your code that might look like this:
With this:
This will then automatically add the use statement to the header of the class and will update the class name with
File
as needed.To see the list of all Joomla Powers: https://git.vdm.dev/joomla/joomla-powers#index-of-joomla-powers
You can add any Joomla class (using the JPK) anywhere in any custom code area in JCB and JCB will take care of the rest. Should you like to add classes that we have not yet added, Just open an issue here https://git.vdm.dev/joomla/joomla-powers/issues and we will add it.
So just as an heads up Joomla want you to use
Joomla\Filesystem\File
instead ofJoomla\CMS\Filesystem\File
and so we already took care of this, as you will see:When you target Joomla 3, we will use
Joomla\CMS\Filesystem\File
but all other versionsJoomla\Filesystem\File
as stated here.Thank your for your advice. The Power feature is really powerful - and worked like a charm!
Give JCB a positive review on the Joomla index 👍