Application Configuration

You should give an array of config or an ini config file(see Yaf_Config_Ini) path to Yaf_Application::__construct().

Yaf will merge the application configurations and user configurations automatically. The application configurations have prefix "yaf." or "application.". If both "yaf." and "application." exist, "application." will be accepted preferentially.

Beispiel #1 An PHP array example

<?php
    $configs 
= array(
            
"application" => array(
                
"directory" => dirname(__FILE__),
                
"dispatcher" => array(
                      
"catchException" => 0,
                    ),
                
"view" => array(
                       
"ext" => "phtml",
                    ),
                ),
           );
    
$app = new Yaf_Application($configs);
?>

Beispiel #2 An ini file example

[yaf]
yaf.directory = APPLICATION_PATH "/appliation"
yaf.dispatcher.catchException = 0

[product : yaf]
; user configuration list here

Yaf Application Config
Name Standard Changelog
application.directory  
application.ext "php"
application.view.ext "phtml"
application.modules "index"
application.library application.directory . "/library"
application.library.directory application.directory . "/library"
application.library.namespace ""
application.bootstrap application.directory . "/Bootstrap" . application.ext
application.baseUri ""
application.dispatcher.defaultRoute  
application.dispatcher.throwException 1
application.dispatcher.catchException 0
application.dispatcher.defaultModule "index"
application.dispatcher.defaultController "index"
application.dispatcher.defaultAction "index"
application.system  

Hier eine kurze Erklärung der Konfigurationsoptionen:

application.directory string

The directory of the application, that is the folder which contains the "controllers", "views", "models", "plugins" folders.

Hinweis:

This config entry is the only one which doesn't has a default value. You should always define it manually.

application.ext string

The file ext of the PHP script, used in class autoloading( Yaf_Loader).

application.view.ext string

The file ext of the view template scripts.

application.modules string

A comma-separated list of the registered modules, used in the route process, especially while there are more than three segments in the PATH_INFO,

Yaf need a way to find out whether the first segment is a module name or not.

application.library string

The local library directory, see Yaf_Loader and yaf.library.

Hinweis:

After Yaf 2.1.6, this config entry can be an array. The library path will try to use the items setted in application.library.directory

application.library.directory string

Alias of application.library. Introduced in Yaf 2.1.6

application.library.namespace string

A comma-separated prefix of local library namespace.

Introduced in Yaf 2.1.6

application.bootstrap string

A absolute path of the Bootstrap class script.

application.baseUri string

Used to remove a fixed prefix of request uri in route process. Take a example, comes a request with request uri "/prefix/controller/action". if you set application.baseUri to "/prefix", then only "/controller/action" will take as the PATH_INFO in route process.

In generally, there is no need to set this value.

application.dispatcher.throwException bool

If it set to On, Yaf will throw an exception while some error occurring. See also Yaf_Dispatcher::throwException().

application.dispatcher.catchException bool

If it set to On, Yaf will forward to Error controller/Action while there is an unhandled exception. See also Yaf_Dispatcher::catchException().

application.dispatcher.defaultRoute string

The default Route, if it is not specificed, Static route will be used as default. See: Yaf_Router::addRoute().

application.dispatcher.defaultModule string

The default module name, see also Yaf_Dispatcher::setDefaultModule().

application.dispatcher.defaultController string

The default controller name, see also Yaf_Dispatcher::setDefaultController().

application.dispatcher.defaultAction string

The default action name, see also Yaf_Dispatcher::setDefaultAction().

application.system string

Set yaf runtime configure in application.ini, like: application.system.lowcase_path

Hinweis:

only those PHP_INI_ALL configures can be set in this way

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Neuigkeiten für PHP-Entwickler: Laravel 11 Veröffentlichung

Am 12. März 2024 wurde die lang erwartete Version 11 des Laravel-Frameworks veröffentlicht, die eine Reihe von spannenden Neuerungen und Verbesserungen für die PHP-Entwicklungsgemeinschaft mit sich bringt. ...

Mike94

Autor : Mike94
Kategorie: PHP Magazin

Technisches SEO bleibt relevant

Technisches SEO – Was ist das überhaupt? Technisches SEO bezieht sich auf die Optimierung der technischen Aspekte deiner Webseite. Das Ziel ist klar! ...

admin

Autor : admin
Kategorie: SEO & Online-Marketing

Was ist neu in der PHP 8.2.10

PHP 8.2.10 ist eine der neuesten Versionen von PHP, die eine Reihe von Verbesserungen und neuen Funktionen mit sich bringt. In diesem Artikel werden wir einige der herausragenden Neuerungen und Verbesserungen dieser Version diskutieren. ...

admin

Autor : admin
Kategorie: Software-Updates

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Seltsames Verhalten von execute() oder Fehler meinerseits

Hallo liebe Community, ich habe ein kleines Problem und vielleicht kann mir ja jemand helfen, würde ich mich sehr drüber freuen. Unten steht e ...

Geschrieben von garibaldiwz am 22.03.2024 13:03:12
Forum: SQL / Datenbanken
Google reCAPTCHA in Kontaktformular einbinden

Überprüfen Sie den E-Mail-Versand: Stellen Sie sicher, dass die E-Mail-Funktion mail() ordnungsgemäß funktioniert und dass keine Fehler beim V ...

Geschrieben von Gast am 18.03.2024 04:54:16
Forum: PHP Developer Forum
`count.php`

Hallo cober93327, und Danke fuer deine Antwort! :-) Naja, so einen "Besucherzähler" auf der Webseite anzuzeigen ist schon eher etwas, das man a ...

Geschrieben von kekse1 am 17.03.2024 15:56:38
Forum: Projekthilfe
`count.php`

Es gibt dazu natuerlich auch eine recht ausfuehrliche Dokumentation in meinem GitHub-Repository Es würde meiner Ansicht nach enorm helfen, wenn D ...

Geschrieben von cober93327 am 14.03.2024 15:49:28
Forum: Projekthilfe