PHP code example of netflie / componentes

1. Go to this page and download the library: Download netflie/componentes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netflie / componentes example snippets


<my-alert type="error" message="I'm an Alert" />

<div class="alert error">I'm an alert</div>

<div class="alert {{ $type }}">
  {{ $message }}
</div>

 declare(strict_types=1);

namespace Foo\Bar;

use Netflie\Componentes\Componentes;

$viewPath = realpath(__DIR__ . '/views'); // your project views folder

$componentes = Componentes::create($viewPath);

{{-- your_project/views/components/alert.blade.php --}}

<div class="alert {{ $type }}">
  {{ $message }}
</div>

<h1>My view</h1>

<x-alert type="error" message="I'm an Alert" />



namespace Foo\Bar;
$input_html = '<html>'
               .'My webpage code precompiled by my own framework'
               .'<x-alert/>'
            .'</html>';
$ouput_html = $componentes->render($input_html);