Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

JCB! Power

class Converter (Details)

namespace: VDM\Minify\Path

@startuml

class Converter  #Gold {
  # $from
  # $to
  + __construct(string $from, string $to, ...)
  # normalize(string $path) : string
  # shared(string $path1, string $path2) : string
  + convert(string $path) : string
  # dirname(string $path) : string
}

note right of Converter::__construct
  

  
  arguments:
    string $from
    string $to
    string $root = ''
end note

note right of Converter::normalize
  Normalize path.

  return: string
end note

note right of Converter::shared
  Figure out the shared path of 2 locations.
Example:
/home/forkcms/frontend/core/layout/images/img.gif
and
/home/forkcms/frontend/cache/minified_css
share
/home/forkcms/frontend

  return: string
end note

note right of Converter::convert
  Convert paths relative from 1 file to another.
E.g.
../images/img.gif relative to /home/forkcms/frontend/core/layout/css
should become:
../../core/layout/images/img.gif relative to
/home/forkcms/frontend/cache/minified_css

  return: string
end note

note right of Converter::dirname
  Attempt to get the directory name from a path.

  return: string
end note

@enduml

The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.

By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the Power from the repository into your project. This makes it available in your JCB instance, allowing you to edit and include the class in your generated Joomla component.

JCB uses placeholders like [[[NamespacePrefix]]] and [[[ComponentNamespace]]] in namespacing to prevent collisions and improve reusability across different JCB systems.

You can also set the JCB powers path globally or per component under the Dynamic Integration tab, providing flexibility and maintainability.

To add this specific Power to your project in JCB:

Simply use this SPK:

Super---39f8957f_cc73_4da5_8b60_6cf25d4ab058---Power

Remember to replace the --- with ___ to activate this Power in your code.


Joomla Volunteer Portal Octoleo Llewellyn Telegram Mastodon X (Twitter) GitHub YouTube n8n Docker Hub Open Collective GPG Key