- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Home
        Safouane Ahmed Salah edited this page May 8, 2021 
        ·
        5 revisions
      
    Welcome to the PHP-React-Component wiki!
composer require phpreact/component
The PHP-React-Component enable the web developer to code elegantly and produce the lightweight web page.
simple as you can see here
 class CustomComponent extends Component{
    function render(){
        $divs = [];
        for($i=0; $i<5;$i++) $divs[] = new div('I am div', ['style'=> 'background:red;color:white']);
        return [
            new h1('Custom component width 5 red divs'),
            new div($divs),
        ];
    }
}
echo new CustomComponent 
/*
this produces 
<h1>Custom component width 5 red divs</h1>
<div>
  <div style="background:red;color:white">I am div</div>
  <div style="background:red;color:white">I am div</div>
  <div style="background:red;color:white">I am div</div>
  <div style="background:red;color:white">I am div</div>
  <div style="background:red;color:white">I am div</div>
</div>
*/