PHPackages                             ivopetkov/html-server-components-bearframework-addon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ivopetkov/html-server-components-bearframework-addon

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ivopetkov/html-server-components-bearframework-addon
====================================================

HTML Server Components addon for Bear Framework

v1.4.0(5mo ago)03.7k10MITPHPPHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*|8.5.\*

Since Feb 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/ivopetkov/html-server-components-bearframework-addon)[ Packagist](https://packagist.org/packages/ivopetkov/html-server-components-bearframework-addon)[ Docs](https://github.com/ivopetkov/html-server-components-bearframework-addon)[ RSS](/packages/ivopetkov-html-server-components-bearframework-addon/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (3)Versions (27)Used By (10)

HTML Server Components
======================

[](#html-server-components)

Addon for Bear Framework

This addon brings HTML Server Components to [Bear Framework](https://bearframework.com/).

[![Build Status](https://camo.githubusercontent.com/f19fd89103ad13c5bd2d6d42e726c29ac749b161ed140dd37592387164b2ed6c/68747470733a2f2f7472617669732d63692e6f72672f69766f7065746b6f762f68746d6c2d7365727665722d636f6d706f6e656e74732d626561726672616d65776f726b2d6164646f6e2e737667)](https://travis-ci.org/ivopetkov/html-server-components-bearframework-addon)[![Latest Stable Version](https://camo.githubusercontent.com/459c259d1a95068be097b0996cfcff71a0623d59ab897bc3c8b41b631943bfbe/68747470733a2f2f706f7365722e707567782e6f72672f69766f7065746b6f762f68746d6c2d7365727665722d636f6d706f6e656e74732d626561726672616d65776f726b2d6164646f6e2f762f737461626c65)](https://packagist.org/packages/ivopetkov/html-server-components-bearframework-addon)[![codecov.io](https://camo.githubusercontent.com/a34fae456cd58d059b737630d29bfc13232cf80baa712a354aba8407aa97c6de/68747470733a2f2f636f6465636f762e696f2f6769746875622f69766f7065746b6f762f68746d6c2d7365727665722d636f6d706f6e656e74732d626561726672616d65776f726b2d6164646f6e2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/ivopetkov/html-server-components-bearframework-addon?branch=master)[![License](https://camo.githubusercontent.com/12108a6f9e1e815dbb2d917bfd2e6c204352c98181c948b7270819eee698b039/68747470733a2f2f706f7365722e707567782e6f72672f69766f7065746b6f762f68746d6c2d7365727665722d636f6d706f6e656e74732d626561726672616d65776f726b2d6164646f6e2f6c6963656e7365)](https://packagist.org/packages/ivopetkov/html-server-components-bearframework-addon)[![Codacy Badge](https://camo.githubusercontent.com/b9ad43e714eb23889ddd66193696a886f862780cbcbf1edaeadc5f88fd3c8571/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3166366432633137303966333464376238656135343766613334306564376235)](https://www.codacy.com/app/ivo_2/html-server-components-bearframework-addon)

Download and install
--------------------

[](#download-and-install)

**Install via Composer**

```
composer require ivopetkov/html-server-components-bearframework-addon
```

**Download an archive**

Download the [latest release](https://github.com/ivopetkov/html-server-components-bearframework-addon/releases) from the [GitHub page](https://github.com/ivopetkov/html-server-components-bearframework-addon) and include the autoload file.

```
include '/path/to/the/addon/autoload.php';
```

Enable the addon
----------------

[](#enable-the-addon)

Enable the addon for your Bear Framework application.

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

Documentation
-------------

[](#documentation)

A reference to the HTML Server Components object (IvoPetkov\\BearFramework\\Addons\\HTMLServerComponents) is available at `$app->components`

### Examples

[](#examples)

Let's create a demo component file at app/components/footer.php

```

        This is the footer

```

Convert components code into HTML code

```
echo $app->components->process('');
// Output:
// This is the footer
```

Create aliases

```
$app->components->addAlias('footer', 'file:app/components/footer.php');
echo $app->components->process('');
// Output:
// This is the footer
```

### Classes

[](#classes)

#### IvoPetkov\\BearFramework\\Addons\\HTMLServerComponents

[](#ivopetkovbearframeworkaddonshtmlservercomponents)

HTML Server Components utilities

##### Methods

[](#methods)

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

Adds an alias

*Parameters*

 `$alias`

 The alias

 `$original`

 The original source name

*Returns*

 No value is returned

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

Converts components code (if any) into HTML code

*Parameters*

 `$content`

 The content to be processed

 `$options`

 Compiler options

*Returns*

 The result HTML code

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

Creates a component from the file specified and processes the content

*Parameters*

 `$file`

 The file to be run as component

 `$attributes`

 Component object attributes

 `$innerHTML`

 Component object innerHTML

 `$variables`

 List of variables that will be passes to the file. They will be available in the file scope.

 `$options`

 Compiler options

*Returns*

 The result HTML code

License
-------

[](#license)

HTML Server Components addon for Bear Framework is open-sourced software. It's free to use under the MIT license. See the [license file](https://github.com/ivopetkov/html-server-components-bearframework-addon/blob/master/LICENSE) for more information.

Author
------

[](#author)

This addon is created by Ivo Petkov. Feel free to contact me at [@IvoPetkovCom](https://twitter.com/IvoPetkovCom) or [ivopetkov.com](https://ivopetkov.com).

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance71

Regular maintenance activity

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~143 days

Recently: every ~445 days

Total

26

Last Release

163d ago

Major Versions

v0.8.0 → v1.0.02021-01-02

PHP version history (7 changes)v0.1.0PHP &gt;=5.5.0

v0.5.0-beta.2PHP &gt;=7.1.0

v1.0.1PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*|8.0.\*

v1.1.0PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*|8.0.\*|8.1.\*

v1.2.0PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*|8.0.\*|8.1.\*|8.2.\*|8.3.\*

v1.3.0PHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*

v1.4.0PHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*|8.5.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/c06ddc5a1d8a94abf93b332db93ae6d03cbe97c1f2a4acf18450c7fbb25a4316?d=identicon)[ivopetkov](/maintainers/ivopetkov)

---

Top Contributors

[![ivopetkov](https://avatars.githubusercontent.com/u/13205385?v=4)](https://github.com/ivopetkov "ivopetkov (85 commits)")

---

Tags

htmlBear Framework addonHTML Server Components

### Embed Badge

![Health badge](/badges/ivopetkov-html-server-components-bearframework-addon/health.svg)

```
[![Health](https://phpackages.com/badges/ivopetkov-html-server-components-bearframework-addon/health.svg)](https://phpackages.com/packages/ivopetkov-html-server-components-bearframework-addon)
```

###  Alternatives

[spatie/laravel-html

A fluent html builder

8376.4M72](/packages/spatie-laravel-html)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21320.9M15](/packages/caxy-php-htmldiff)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

2899.6M48](/packages/yajra-laravel-datatables-html)[mkalkbrenner/php-htmldiff-advanced

An add-on for the php-htmldiff library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

3517.8M1](/packages/mkalkbrenner-php-htmldiff-advanced)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
