<commit_before># Beatrix

Let's beat the Bitrix defectiveness. You should not know what is inside.

![Make Bitrix adopted to real world](http://news.rin.ru/pictures/16/249031.jpg)

## What i have to do?

Just download `beatrix.phar` or build it by yourself using [Box](http://box-project.org/)

```
php box.phar build
```

Include `beatrix.phar` at Bitrix startup (recommended in /bitrix/php_interface/init.php, create if not exists).

Initialize just constructing Beatrix instance:

```php
new Beatrix(/* array of Slim options*/);
```

Some options will be forced internally, others available as described in [Slim docs](http://docs.slimframework.com/#Application-Settings)

## Nothing changed. What's next?

Of course. There is no magic (almost), you have to write some code yourself.
All Beatrix instance methods available through `Beatrix::app()`, also we have some useful shortcut functions.

For now we have following features:

### Blade engine

Brings us all [Blade](http://laravel.com/docs/templates#blade-templating) powers, templates inheritance, blocks, etc.
Handles any .php and .blade.php templates, but first extensions will be treated as «clean» PHP scripts.

Just add one or more template dirs at runtime and do Blade magic:

```php
Beatrix::app()->addViewsDir('/path/to/templates/dir');
Beatrix::app()->addViewsDir(array('/one/more', '/any/path/'));

// then just
blade('template/name', array('param'=>$val), /* add true for return rendering result */);
```

### Slim instance running

Beatrix is [Slim](http://slimframework.com/) app with some tricky tunings under the hood. But we still have all routing power of Slim.

It allows to handle any non-static site part with __no more /urlrewrite.php!__

Put `.htaccess` in desired directory:
<commit_msg>Replace web illustrations with our own mascot<commit_after>![Make Bitrix adopted to real world](http://velosipedist.org/images/beatrix/mascot-mini.png)

# Beatrix

Attempt to beat the Bitrix defectiveness. You should not know what is inside.

## What i have to do?

Just download `beatrix.phar` or build it by yourself using [Box](http://box-project.org/)

```
php box.phar build
```

Include `beatrix.phar` at Bitrix startup (recommended in /bitrix/php_interface/init.php, create if not exists).

Initialize just constructing Beatrix instance:

```php
new Beatrix(/* array of Slim options*/);
```

Some options will be forced internally, others available as described in [Slim docs](http://docs.slimframework.com/#Application-Settings)

## Nothing changed. What's next?

Of course. There is no magic (almost), you have to write some code yourself :unamused:.

All Beatrix instance methods available through `Beatrix::app()`, also we have some useful shortcut functions.

For now we have following features:

### Blade engine

Brings us all [Blade](http://laravel.com/docs/templates#blade-templating) powers, templates inheritance, blocks, etc.
Handles any .php and .blade.php templates, but first extensions will be treated as «clean» PHP scripts.

Just add one or more template dirs at runtime and do Blade magic:

```php
Beatrix::app()->addViewsDir('/path/to/templates/dir');
Beatrix::app()->addViewsDir(array('/one/more', '/any/path/'));

// then just
blade('template/name', array('param'=>$val), /* add true for return rendering result */);
```

### Slim instance running

Beatrix is [Slim](http://slimframework.com/) app with some tricky tunings under the hood. But we still have all routing power of Slim.

It allows to handle any non-static site part with __no more /urlrewrite.php!__

Put `.htaccess` in desired directory:

{'fraction_non_alphanumeric': 0.11854525263742366, 'fraction_numerical': 0.002220988339811216, 'mean_word_length': 4.700949367088608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5946633', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1042, 'n_words': 425}