2
Docs2
2
$Painfree->logic()
$Painfree->logic() : void
$Painfree->logic() : void
This function is called automatically by PHPainfree2
and loads the defined ApplicationController.
This is an internal function to PHPainfree2
and is not meant to be called by applications.
include $Painfree->logic(); // load the application logic controller
public function logic() : void {
return $this->options['LogicFolder'] .
'/' . $this->options['ApplicationController'];
}
What | Where | How |
---|---|---|
Configured | PainfreeConfig.php | $PainfreeConfig['ApplicationController']; |
Called | Painfree.php | $Painfree->logic(); |
PHPainfree/
|-- htdocs/
|-- includes/
| |-- PainfreeConfig.php
| |-- Painfree.php
| |-- App.php
| `-- Controllers/
`-- templates/
|-- app.php
`-- views/
`-- main.php
[exec: 0.0025s]
App = App Object
(
[title:App:private] => Painfree-logic - Documentation | PHPainfree2
[htmx] =>
[htmx_boosted] =>
[route] => docs/painfree-logic
[view] => docs
[id] => painfree-logic
[action] =>
[data] => Array
(
[doc] => painfree-logic
)
[objects] => Array
(
)
[BASE_PATH] => /var/www/vhosts/php.programming-is-easy.com
)
Painfree = PHPainfree Object
(
[Version] => 2.2.1
[URI] => https://php.programming-is-easy.com/docs/painfree-logic
[route] => docs/painfree-logic
[Root] => /var/www/vhosts/php.programming-is-easy.com/
[db] =>
[Autoload] => Array
(
)
[__debug] => Array
(
[App] => App Object
(
[title:App:private] => Painfree-logic - Documentation | PHPainfree2
[htmx] =>
[htmx_boosted] =>
[route] => docs/painfree-logic
[view] => docs
[id] => painfree-logic
[action] =>
[data] => Array
(
[doc] => painfree-logic
)
[objects] => Array
(
)
[BASE_PATH] => /var/www/vhosts/php.programming-is-easy.com
)
)
[options:PHPainfree:private] => Array
(
[ApplicationController] => App.php
[BaseView] => app.php
[DefaultRoute] => main
[PublicFolder] => htdocs
[TemplateFolder] => templates
[LogicFolder] => includes
[ControllerFolder] => Controllers
[ImagesFolder] => images
[CssFolder] => css
[JsFolder] => js
[DynamicFolder] => views
[Database] => Array
(
)
[RouteParameter] => route
)
)
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.
$TestArray = Array
(
[this_is] => a simple dummy array.
[example] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
$PainfreeConfig = Array
(
[ApplicationController] => App.php
[BaseView] => app.php
[DefaultRoute] => main
[PublicFolder] => htdocs
[TemplateFolder] => templates
[LogicFolder] => includes
[ControllerFolder] => Controllers
[ImagesFolder] => images
[CssFolder] => css
[JsFolder] => js
[DynamicFolder] => views
[Database] => Array
(
)
[RouteParameter] => route
)
EXAMPLE = You can basically pass anything to $Painfree->debug().