douglasgreen / pagemaker
A project to build webpages in OOP style with a plug-in architecture
0.1.1
2024-06-01 00:30 UTC
Requires
- php: >=8.1
Requires (Dev)
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5
- rector/rector: ^1.0
- symplify/easy-coding-standard: ^12.2
README
A project to build webpages in OOP style with a plug-in architecture
Project setup
Standard config files for linting and testing are copied into place from a GitHub repository called utility. See that project's README page for details.
Usage
The page builder provides a set of classes to assemble an HTML page.
Installing assets
Widgets are installed with composer to the vendor directory of your main project. Then you should copy their assets to the public/widgets/ directory with the name of your widget. You can do so with a simple Bash script in your main project like this:
#!/bin/bash # Set the source and destination directories VENDOR_DIR="vendor/your-package-name" PUBLIC_DIR="public/widgets" # Create the destination directory if it doesn't exist mkdir -p $PUBLIC_DIR # Copy JavaScript files cp -R $VENDOR_DIR/assets/js/* $PUBLIC_DIR/js/ # Copy CSS files cp -R $VENDOR_DIR/assets/css/* $PUBLIC_DIR/css/ # Copy image files cp -R $VENDOR_DIR/assets/images/* $PUBLIC_DIR/images/ echo "Assets copied successfully!"