Skip to content

DungBuiDeveloper/php-oop-design-partern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOP DESIGN FOR PHP

Stragery

use \PhpOop\stragery\ConcreteStrategyA;
use \PhpOop\stragery\ConcreteStrategyB;

use \PhpOop\stragery\Context;


$a = new ConcreteStrategyA();
$b = new ConcreteStrategyB();
$context = new Context($a);
echo "Client: Strategy is set to normal sorting.\n";
$context->doSomeBusinessLogic();

echo "<br/>";

$context = new Context($b);
echo "Client: Strategy is set to reverse sorting..\n";
$context->doSomeBusinessLogic();

About

- Nơi lưu trữ các design hay dùng trong php

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages