Download the PHP package steampixel/simple-php-portals without Composer
On this page you can find all versions of the php package steampixel/simple-php-portals. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download steampixel/simple-php-portals
More information about steampixel/simple-php-portals
Files in steampixel/simple-php-portals
Package simple-php-portals
Short Description This is a simple, puristic and small PHP portal engine. Throw your contents back and forth through time.
License MIT
Informations about the package simple-php-portals
Simple PHP Portals βΆπ³β
Hey! This is a simple, puristic and small single class PHP portal engine. With portals, you can send contents (strings) from any procedural point of your app to any other point. Throw your contents back and forth through time. A portal is a single point of time and space inside your template or app. You can just open portals and then send contents to there from any other location of your app. No mater if the target portal is defined before or after you will send content to there. This makes portals extremely efficient. Portals just work by replacing strings and will not require complex parsing. So this approach is very fast.
π Simple example:
πΆ Installation using Composer
Just run composer require steampixel/simple-php-portals
Than add the autoloader to your project like this:
β Prepend contents instead of appending them
Sometimes you want to prepend contents to a portal instead of appending it. Just set the third parameter to true to prepend the content to the current stack.
β Send contents only once
Sometimes contents should only send once to a portal. No mater how often they are sent to there. This is useful if some plugins or theme partials requires the same resources, for example. Set the fourth parameter to true, so the following JavaScript will only be sent once:
π’ Test setup with Docker
I have created a little Docker test setup.
-
Build the image:
docker build -t simplephpportals docker/image-php-7.4.1
-
Spin up a container:
docker run -d -p 80:80 -v $(pwd):/var/www/html --name simplephpportals simplephpportals
- Open your browser and navigate to http://localhost
π License
This project is licensed under the MIT License. See LICENSE for further information.