2017 © Pedro Peláez
 

library dynamic

Syntactic sugar for everyone.

image

ilya/dynamic

Syntactic sugar for everyone.

  • Saturday, May 10, 2014
  • by ilya.s
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Dynamic

Syntactic sugar for everyone., (*1)

Dynamic helps you handle calls to non-existent methods., (*2)

Example

<?php require __DIR__.'/../vendor/autoload.php';

use Dynamic\DynamicTrait;

class Example {

    use DynamicTrait;

    public function __construct()
    {
        $this->getDynamicInstance()->redirect('/^say(\w+)To$/', 'say');
    }

    public function say($what, $to)
    {
        echo ucfirst("$what, $to!"), PHP_EOL;
    }

}

$example = new Example;

echo $example->sayHelloTo('Jack'), $example->sayByeTo('John');

Can you guess what the output will be? Check it out yourself!, (*3)

git clone https://github.com/ilya-dev/dynamic.git
cd dynamic
php examples/first.php

Documentation

Don't forget to add Dynamic\DynamicTrait trait to your class., (*4)

  • void redirect(string $pattern, string $method)
  • mixed handle(mixed $instance, string $method, array $arguments = [])

Installation

php composer.phar require "ilya/dynamic:~1"

License

Dynamic is licensed under the MIT license., (*5)

The Versions

10/05 2014

dev-master

9999999-dev

Syntactic sugar for everyone.

  Sources   Download

MIT

The Development Requires

by Ilya S

10/05 2014

1.0.0

1.0.0.0

Syntactic sugar for everyone.

  Sources   Download

MIT

The Development Requires

by Ilya S