PHP code example of ivopetkov / html-server-components-bearframework-addon

1. Go to this page and download the library: Download ivopetkov/html-server-components-bearframework-addon 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/ */

    

ivopetkov / html-server-components-bearframework-addon example snippets




$app->addons->add('ivopetkov/html-server-components-bearframework-addon');

echo $app->components->process('<component src="file:app/components/footer.php" />');
// Output:
// <!DOCTYPE html><html><head></head><body><footer>This is the footer</footer></body></html>

$app->components->addAlias('footer', 'file:app/components/footer.php');
echo $app->components->process('<component src="footer" />');
// Output:
// <!DOCTYPE html><html><head></head><body><footer>This is the footer</footer></body></html>

public void addAlias ( string $alias , string $original )

public string process ( string $content [, array $options = [] ] )

public string processFile ( string $file [, array $attributes = [] ]  [, string $innerHTML = '' ]  [, array $variables = [] ]  [, array $options = [] ] )