PHPackages                             truecastdesign/truefw - 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. [Framework](/categories/framework)
4. /
5. truecastdesign/truefw

ActiveLibrary[Framework](/categories/framework)

truecastdesign/truefw
=====================

This file structure works with the True framework.

v1.1.24(1w ago)260MITPHP

Since Apr 10Pushed 1w ago1 watchersCompare

[ Source](https://github.com/truecastdesign/truefw)[ Packagist](https://packagist.org/packages/truecastdesign/truefw)[ RSS](/packages/truecastdesign-truefw/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (27)Used By (0)

True Framework File Structure - New Project

[![True Framework](https://raw.githubusercontent.com/truecastdesign/true/master/assets/TrueFramework.png "True Framework")](https://raw.githubusercontent.com/truecastdesign/true/master/assets/TrueFramework.png)

v1.1.24

This file structure is used by the True Framwork located at \[GitHub Repo True\]:

Requires PHP 8.2 or newer.

Install
-------

[](#install)

To install a new project with composer:

```
$ composer create-project truecastdesign/truefw project-name
```

Usage
-----

[](#usage)

Build your website in the app folder using the available folder structure.

The app folder should be located beside the public folder. Assets, such as images, css, js, pdfs, etc., should be located in the assets folder inside the public folder.

Table of Contents for Detailed Docs of the True base classes
------------------------------------------------------------

[](#table-of-contents-for-detailed-docs-of-the-true-base-classes)

[App](./docs/App.md)

[Routing](./docs/Routes.md)

[Authentication](./docs/Auth.md)

[Task Queue](./docs/TaskQueue.md)

[Nonce Generator](./docs/Nonce.md)

Models
------

[](#models)

The business logic should live in the app/models directory.

The name space for them should be App.

Access with \\App\\ClassName();

Views
-----

[](#views)

Views live in the app/views directory.

The top level of it will automatically be accessed using the default route. A use like this  will access the file index.phtml. Urls like  will access the file app/views/about.phtml. To make a sub page of /about, create a directory inside views and name it the same as the file but without the .phtml part.

```
http://www.domain.com/about 		-> 	about.phtml
http://www.domain.com/about/staff 	-> 	about/staff.phtml

```

The page view files have meta data located at the top of the phtml file.

```
title="Title of the page for the title tag"
description="The meta description content."
{endmeta}
```

#### example docs:

[](#example-docs-httpplatesphpcomv3simple-example)

The {endmeta} string is the delimiting end of the meta data and the start of the html and PHP. The meta data uses config ini file formatting rules.

The title key maps to $\_metaTitle in the layout.

The description key maps to $\_metaDescription.

The css key files get combined with other css files and minified and outputted in the $\_css variable. It should look like this: css="/assets/css/file.css, /assets/css/file2.css"

The js key is for including JavaScript files in the page. They will be combined and minified and outputted in the $\_js variable. It has a similar format to the css files.

The \_layouts directory is where the base.phtml file lives and it has the header and footer in one file. The view content gets inserted into the middle of it after being processed with PHP.

The \_partials directory is for storing parts of pages that can be used on multiple pages. You can include them using the {partial:filename.phtml} string.

Controllers
-----------

[](#controllers)

Controllers for the page are not required but if you need more functionality they are where you can access models and pass them to the view. Use the $vars array with a unique key and value to pass variables to the view. Example: $vars\['info'\] = 'Info details.';

The controller filename should match the views filename but with a .php extension rather than a .phtml extension.

Create the same folder structure as the view for sub and sub sub page. You can store controllers for APIs or other site features in there as well. You probably want to put them in a folder that starts with an underscore and include it directly in the routes.php files.

Routes
------

[](#routes)

The app/routes.php file is for storing all your site routes in. The App class has get, post, put, patch, delete, options, and any methods available. Those will match the incoming request method. The 'any' method will match all of them.

```
$App->get('/api/person/:value', function($request) use ($App) {
	$vars = [];
	# if the code is short you can put it in here and if too long include a controller here and put your code in the controller file.

	$App->view->render('_api/person.phtml', $vars);
});
```

Be sure to order your routes from most specific to most general. Once a route matches a request, all routes below will not be checked or run. The main route for page handling should always be the last one as it matches all requests.

Init
----

[](#init)

The init.php file if for all your bootstrap code. It runs on each request so try to keep it minimal.

This line:

```
$App->view = new \True\PhpView();
```

is for using the PHP view method. If you want to use something like Twig as your template system, you can change it here and use what ever you like.

global functions
----------------

[](#global-functions)

### p(array|object)

[](#parrayobject)

Quickly print out an array or object

### pr(array|object)

[](#prarrayobject)

Preformatted print out an array or object

### pMethods(class object)

[](#pmethodsclass-object)

Print out a list of methods in the class. Good for exploring an API.

### currency(string|int)

[](#currencystringint)

Return number formatted for US currency

### esc(string|int|float, type)

[](#escstringintfloat-type)

Easily escape the output of all kinds of data with a shorter syntax than the builtin PHP function. Types you can pass: string (default), email, encoded, float, int, url.

Issues
------

[](#issues)

When running on localhost, cookies for logging into admin area will not set using Chrome. They require a domain. Use Firefox or Safari to develop site.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~103 days

Recently: every ~178 days

Total

26

Last Release

9d ago

### Community

Maintainers

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

---

Top Contributors

[![truecastdesign](https://avatars.githubusercontent.com/u/18723650?v=4)](https://github.com/truecastdesign "truecastdesign (13 commits)")

---

Tags

phpframeworkmicronanotrue

### Embed Badge

![Health badge](/badges/truecastdesign-truefw/health.svg)

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

###  Alternatives

[rakibtg/sleekdb

SleekDB - A NoSQL Database made using PHP

984116.7k19](/packages/rakibtg-sleekdb)

PHPackages © 2026

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