PHPainfree2 Docs

$Painfree->view() - Documentation | PHPainfree2

PHPainfree2 $Painfree->view()

$Painfree->view() : void

$Painfree->view() : void

This function is called automatically by PHPainfree2 and loads the defined BaseView.

WARNING

This is an internal function to PHPainfree2 and is not meant to be called by applications.

$Painfree->logic()

include $Painfree->view(); // load the application logic controller

public function view() : void {
	return $this->options['TemplateFolder'] . 
		'/' . $this->options['BaseView'];
}
$Painfree->view()
What Where How
Configured PainfreeConfig.php $PainfreeConfig['TemplateFolder'];
Configured PainfreeConfig.php $PainfreeConfig['BaseView'];
Called Painfree.php $Painfree->view();
PHPainfree/
|-- htdocs/
|-- includes/
|   |-- PainfreeConfig.php
|   |-- Painfree.php
|   |-- App.php
|   `-- Controllers/
`-- templates/
    |-- app.php
	`-- views/
	    `-- main.php

PHPainfree Debugging Console [exec: 0.0033s]

1. App

App = App Object
(
    [env] => development
    [title:App:private] => Painfree-view -  | Documentation |  | PHPainfree2
    [htmx] => 
    [htmx_boosted] => 
    [headers] => Array
        (
            [accept] => */*
            [user-agent] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [accept-encoding] => gzip, br, zstd, deflate
            [host] => php.programming-is-easy.com
        )

    [response_headers] => Array
        (
            [X-Frame-Options] => SAMEORIGIN
        )

    [route] => docs/painfree-view
    [app] => 
    [view] => docs
    [id] => painfree-view
    [action] => 
    [output_file] => 
    [data] => Array
        (
            [doc] => painfree-view
        )

    [objects] => Array
        (
        )

    [BASE_PATH] => /var/www/vhosts/php.programming-is-easy.com
    [BASE_URI] => https://php.programming-is-easy.com
    [db] => 
    [route_parts] => Array
        (
            [0] => docs
            [1] => painfree-view
        )

)

2. Painfree

Painfree = PHPainfree Object
(
    [Version] => 2.3.0
    [URI] => https://php.programming-is-easy.com/docs/painfree-view
    [route] => docs/painfree-view
    [Root] => /var/www/vhosts/php.programming-is-easy.com/
    [Autoload] => Array
        (
            [PainfreeUtils.php] => /var/www/vhosts/php.programming-is-easy.com/includes/Autoload/PainfreeUtils.php
        )

    [db] => 
    [__debug] => Array
        (
            [App] => App Object
(
    [env] => development
    [title:App:private] => Painfree-view -  | Documentation |  | PHPainfree2
    [htmx] => 
    [htmx_boosted] => 
    [headers] => Array
        (
            [accept] => */*
            [user-agent] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [accept-encoding] => gzip, br, zstd, deflate
            [host] => php.programming-is-easy.com
        )

    [response_headers] => Array
        (
            [X-Frame-Options] => SAMEORIGIN
        )

    [route] => docs/painfree-view
    [app] => 
    [view] => docs
    [id] => painfree-view
    [action] => 
    [output_file] => 
    [data] => Array
        (
            [doc] => painfree-view
        )

    [objects] => Array
        (
        )

    [BASE_PATH] => /var/www/vhosts/php.programming-is-easy.com
    [BASE_URI] => https://php.programming-is-easy.com
    [db] => 
    [route_parts] => Array
        (
            [0] => docs
            [1] => painfree-view
        )

)

        )

    [options:PHPainfree:private] => Array
        (
            [ApplicationController] => App.php
            [BaseView] => app.php
            [DefaultRoute] => main
            [PublicFolder] => htdocs
            [AppFolder] => apps
            [TemplateFolder] => templates
            [LogicFolder] => includes
            [ControllerFolder] => Controllers
            [ImagesFolder] => images
            [CssFolder] => css
            [JsFolder] => js
            [DynamicFolder] => views
            [Database] => Array
                (
                )

            [RouteParameter] => route
        )

)

3. DebugExamples

DebugExamples = Please be aware that there are several $Painfree->debug() calls made in templates/debug.php to be used as examples. You should probably remove them.

4. $TestArray

$TestArray = Array
(
    [this_is] => a simple dummy array.
    [example] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

5. $PainfreeConfig

$PainfreeConfig = Array
(
    [ApplicationController] => App.php
    [BaseView] => app.php
    [DefaultRoute] => main
    [PublicFolder] => htdocs
    [AppFolder] => apps
    [TemplateFolder] => templates
    [LogicFolder] => includes
    [ControllerFolder] => Controllers
    [ImagesFolder] => images
    [CssFolder] => css
    [JsFolder] => js
    [DynamicFolder] => views
    [Database] => Array
        (
        )

    [RouteParameter] => route
)

6. EXAMPLE

EXAMPLE = You can basically pass anything to $Painfree->debug().