Is the right way to make several variables available to all of my controllers in order to add a file MY_Controller.phpto my folder /application/libraries/( shown in docs here )?
MY_Controller.php
/application/libraries/
I work in Kohana 2.3.4 and wonder if there are any better ways to do this, or is this the only recommended method?
Being new to OOP, can you please connect me with any examples?
I heard that the correct answer is to add vars to yours $config[], trying to get more details.
$config[]
- (application/config/foobar.php) Kohana:: config ('foobar.key').
.
. http://docs.kohanaphp.com/core/kohana#methods_config
:
[bootstrap.php]
Kohana::$config->attach(new Kohana_Config_File('global'));
application/config global.php
():
return (array ('MyFirstVar' => 'Is One', 'MySecondVar' => 'Is Two'));
Kohana::config ('global.MyFirstVar');
, "". ; , global.php.
?: -)
Source: https://habr.com/ru/post/1743067/More articles:On Windows 7: the same way, but Explorer and Java see different files except Powershell - javaC ++ new memory fragmentation - c ++Method splitting (String) undefined for type String - javaWhere are the Kohana configuration files? - installmany to many query - sqlShortest-path algorithms using a space-time trade-off? - algorithmIs a reasonable unit test possible? - javaАлгоритм, который охватывает две страницы в латексе - algorithmКак избежать хаотического развертывания веб-приложений ASP.NET? - asp.netКак проверить динамически созданный файл на Java? - javaAll Articles