Enhance dynamicimages module with refined asset management and image path configuration

- Update `dynamicimages_asset` constructor to prepend working directory to paths.
- Add helper methods (`getPath`, `getWidth`, `getHeight`) to `dynamicimages_asset`.
- Extend `dynamicimages_image_t` trait with debugging and path configuration utilities.
- Refactor asset path handling in `machine_1` with constants for image files.
- Load `dynamicimages` interfaces, traits, classes, helpers, and configurations in `index.php`.
This commit is contained in:
Jeppe Bundgaard
2026-01-27 11:21:07 +01:00
parent f1f7ba1d46
commit e2521e222f
5 changed files with 68 additions and 15 deletions
@@ -33,4 +33,26 @@ trait dynamicimages_image_t
$this->assets[] = $asset;
return $this;
}
/**
* Debug
*/
public function debugAssets(): void
{
echo 'Assets count: ' . count($this->assets) . PHP_EOL;
foreach ($this->assets as $asset) {
echo 'Asset path: ' . $asset->getPath() . ' - (Width: ' . $asset->getWidth() . ', Height: ' . $asset->getHeight() . ')' . PHP_EOL;
}
}
public function getAssetPath(string $asset_name): string
{
return $this->module_asset_path . $asset_name;
}
public function setAssetPath(string $asset_path): dynamicimages_image_i
{
$this->module_asset_path = $asset_path;
return $this;
}
}