landmarx / library
An object oriented landmark library
dev-master
2014-05-18 04:39 UTC
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: 4.1.*
- twig/twig: >=1.2,<2.0-dev
Suggests
- twig/twig: for the TwigRenderer and the integration with your templates
This package is not auto-updated.
Last update: 2025-01-14 08:10:06 UTC
README
Landmark node mapping library for the landmarx system.
- installation
- usage
Installation
Composer
Add this to your composer.json
file:
"landmarx\library": "@dev"
Then run the following command:
$ php composer.phar update "landmarx\library"
Usage
#Basic usage:
use Landmarx\Factory\LandmarkFactory; use Landmarx\Model\Type as LandmarkType; use Landmarx\Renderer\ListRenderer; $factory = new LandmarkFactory(); $mtn_rng = new LandmarkType('mountain range'); $mtn = new LandmarkType('mountain'); $mtn->setParent($mtn_rng); // Landmark created by name only $landmark = new Landmark('appalachian mountain range'); $landmark->setLatitude(74.00)->setLongitude(-47.98); $landmark->setType($mtn_rng); // Child landmark $child = new Landmark('katahdin'); $child->setLatitude(79.76)->setLongitude(-40.99); $child->setType($mtn)->setParent($landmark); // render landarks $renderer = new ListRenderer(); $renderer->render($landmark);
This would output a nest unordered list.
#Advanced Usage