PHPackages                             chp/textcontent - 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. [Database &amp; ORM](/categories/database)
4. /
5. chp/textcontent

ActiveLibrary[Database &amp; ORM](/categories/database)

chp/textcontent
===============

Database content to Anax-MVC

v1.3.1(9y ago)08MITPHPPHP &gt;=5.4

Since Mar 9Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Chibi86/DB-TextContent-for-Anax-MVC)[ Packagist](https://packagist.org/packages/chp/textcontent)[ Docs](http://chibidesign.se)[ RSS](/packages/chp-textcontent/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (5)Versions (13)Used By (0)

DB TextContent for ANAX-MVC
===========================

[](#db-textcontent-for-anax-mvc)

[![Build Status](https://camo.githubusercontent.com/504e3cd90e6e3094105ec8408935343d29567019dea2336d98d9ad91c61a6d04/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436869626938362f44422d54657874436f6e74656e742d666f722d416e61782d4d56432f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Chibi86/DB-TextContent-for-Anax-MVC/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d6b795b1a2bd2ef8df47911233576acb5921ec40bda64069cad64fd42ad9c3d5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436869626938362f44422d54657874436f6e74656e742d666f722d416e61782d4d56432f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Chibi86/DB-TextContent-for-Anax-MVC/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c465e3acbd91e9a02063ed53126c0a5c12a81f4b6302331d9ea42caeeec02ed5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436869626938362f44422d54657874436f6e74656e742d666f722d416e61782d4d56432f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Chibi86/DB-TextContent-for-Anax-MVC/?branch=master)

This controller and modell classes adds possibly to add database administrat content to your Anax-MVC platform, like pages or blog posts.

By Rasmus Berg,

License
-------

[](#license)

This software is free software and carries a MIT license.

Use of external libraries
-------------------------

[](#use-of-external-libraries)

The following external modules are excluded byt will be needed for run this classes.

### Anax-MVC (Get this one first)

[](#anax-mvc-get-this-one-first)

- Github:
- Version: v2.0.x or later
- License: MIT license

### Mos/CDatabase

[](#moscdatabase)

- Github:
- Version: v0.1.1\*
- License: MIT license

### Mos/CForm V2

[](#moscform-v2)

- Github:
- Version: v1.9.8
- License: MIT license

### Anax/CDatabaseModel (Only if you not got your own)

[](#anaxcdatabasemodel-only-if-you-not-got-your-own)

- Github:
- Version: v1.0.1
- License: MIT license

Install instructions
--------------------

[](#install-instructions)

### 1. First you will need to install the other modules (if you not got them already).

[](#1-first-you-will-need-to-install-the-other-modules-if-you-not-got-them-already)

### 2. The easiest way to install this is using composer. Add this to your composer.json:

[](#2-the-easiest-way-to-install-this-is-using-composer-add-this-to-your-composerjson)

```
    "chp/textcontent": "dev-master"
```

### 3. Move `vendor\chp\textcontent\app\view` to `app\view` and `vendor\chp\textcontent\webroot` to `webroot`

[](#3-move-vendorchptextcontentappview-to-appview-and-vendorchptextcontentwebroot-to-webroot)

### 4a. OWN FRONTCONTROLLER

[](#4a-own-frontcontroller)

Include this to your frontcontroller this controllers

```
$di->set('ContentController', function() use ($di) {
    $controller = new \Chp\TextContent\ContentController();
    $controller->setDI($di);
    return $controller;
});
$di->set('BlogController', function() use ($di) {
    $controller = new \Chp\TextContent\BlogController();
    $controller->setDI($di);
    return $controller;
});
$di->set('PageController', function() use ($di) {
    $controller = new \Chp\TextContent\PageController();
    $controller->setDI($di);
    return $controller;
});
```

Don`t forget to config database settings for CDatabase in your frontcontroller etc.

### 4b. MINE FRONTCONTROLLER (content.php)

[](#4b-mine-frontcontroller-contentphp)

Set chmod 777 on `webroot/db` if you want to use sqlite, otherwish config mysql for CDatabase in frontcontroller etc.

### 5. Change config-file

[](#5-change-config-file)

You probly should change url-prefix and other settings in `app/config/text-content.php`.

### 6. Go to `[your-url]/[frontcontroller]/content/setup` to setup database TextContent tables to database.

[](#6-go-to-your-urlfrontcontrollercontentsetup-to-setup-database-textcontent-tables-to-database)

History
-------

[](#history)

\###History for Database TextContent for ANAX-MVC

v1.3.1 (2017-03-16)

- Changes: Comments now follow more phpDocumentor standard with small letters etc
- Changes: Some corrections in the code
- Removed: Slugify on content url-field, user need to follow slugify standard anyway
- Bugfix: Update date on blog post and page now only show when updates has been made after published
- Bugfix: Now all url:s got prefix, before some has been missed
- Bugfix: Fix so php 7 and 7.1 will test with Travis
- And more...

v1.3.0 (2017-03-16)

- Updated: Install guide (readme)
- Added: Config-file 'app/config/text-content.php'
- Added: Help class 'ValidContent' to validate and return valid information
- Added: Test-cases for 'ValidContent'
- Added: InternalServerException if $di is not a object
- Changes: Some Doc Comments to small letters so scrutinizer accept them.
- Removed: Some functions and rebuild in 'ContentController' to just call to 'ValidContent' functions
- Removed: Some test-cases for 'ContentController'
- And more...

v1.2.5 (2017-03-14 - 2017-03-15)

- Added: More testcases, and testcases for Blog and Page controllers
- Change: Clean up classes with smaller functions
- Change: Fix small issues scrutinizer has inform about
- Bugfix: Remove content now works
- Bugfix: Content with no tags, can now edits
- And more...

v1.2.0 (2017-03-12)

- Added: @Property annotations in comments before classes
- Added: Badges
- Removed: Short php open tags
- Removed: Php end tags, where it's not needed

v1.1.1 to 1.1.7 (2017-03-11 - 2017-03-12)

- Added: .phpunit.xml for config phpunit
- Added: Files for Travis
- Added: CDatabaseModel to require in composer for Travis
- Added: Anax-MVC to be require in composer for Travis
- Update: Travis-settings
- Update: Remove short php open tags
- Update: Remove php end tags, where it's not needed
- Update: Remove unused code
- Update: Comment-fixes in ContentController.php
- Update: Add autoload for vendor in test/config.php
- Bugfix: Fix Travis phpunit test
- Bugfix: Fix right namespaces on class calls in test-classes
- Bugfix: Fix so null values is not accepted in class functions
- And more fixes...

v1.1.0 (2017-03-09)

- Added: Phpunit testcases
- Bugfix: Added fallbacks if inputed values is not valid, for some functions
- Bugfix: Fix so sqlite working
- Bugfix: Fix filter validate

v1.0.1 (2016-11-20)

- Added: Sqlite prepare
- Added: More to install instructions and correct somethings
- Added: Link to CDatabaseModel, no need more follow swedish guide...
- Removed: Prepare in frontcontroller for mysql-config file
- Bugfix: That made TextContent not work at all
- Bugfix: That made setup/restore fail

v1.0.0 (2016-11-19)

- First release on Github.

```
Copyright (c) 2016-2017 Rasmus Berg, rasmus.berg@chibidesign.se

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98% 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 ~0 days

Total

12

Last Release

3394d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6161062?v=4)[Rasmus Berg](/maintainers/Chibi86)[@Chibi86](https://github.com/Chibi86)

---

Top Contributors

[![Chibi86](https://avatars.githubusercontent.com/u/6161062?v=4)](https://github.com/Chibi86 "Chibi86 (49 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

pagedatabasecontentblogeducationanax mvc

### Embed Badge

![Health badge](/badges/chp-textcontent/health.svg)

```
[![Health](https://phpackages.com/badges/chp-textcontent/health.svg)](https://phpackages.com/packages/chp-textcontent)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.5k](/packages/doctrine-dbal)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k249.9M4.0k](/packages/doctrine-doctrine-bundle)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k217.3M518](/packages/doctrine-migrations)[doctrine/data-fixtures

Data Fixtures for all Doctrine Object Managers

2.9k143.6M571](/packages/doctrine-data-fixtures)[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k48.7M444](/packages/robmorgan-phinx)[spatie/laravel-backup

A Laravel package to backup your application

6.0k23.4M232](/packages/spatie-laravel-backup)

PHPackages © 2026

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