PHP Класс Prado\TApplicationComponent
TApplicationComponent is the base class for all components that are
application-related, such as controls, modules, services, etc.
TApplicationComponent mainly defines a few properties that are shortcuts
to some commonly used methods. The {@link getApplication Application}
property gives the application instance that this component belongs to;
{@link getService Service} gives the current running service;
{@link getRequest Request}, {@link getResponse Response} and {@link getSession Session}
return the request and response modules, respectively;
And {@link getUser User} gives the current user instance.
Besides, TApplicationComponent defines two shortcut methods for
publishing private files: {@link publishAsset} and {@link publishFilePath}.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Описание методов
getApplication()
публичный Метод
public getApplication ( ) : TApplication |
Результат |
TApplication |
current application instance |
getRequest()
публичный Метод
public getRequest ( ) : THttpRequest |
Результат |
THttpRequest |
the current user request |
getResponse()
публичный Метод
public getResponse ( ) : THttpResponse |
Результат |
THttpResponse |
the response |
getService()
публичный Метод
public getService ( ) : prado\IService |
Результат |
prado\IService |
the current service |
getSession()
публичный Метод
public getSession ( ) : THttpSession |
Результат |
THttpSession |
user session |
getUser()
публичный Метод
public getUser ( ) : IUser |
Результат |
IUser |
information about the current user |
publishAsset()
публичный Метод
This method will publish a private asset (file or directory)
and gets the URL to the asset. Note, if the asset refers to
a directory, all contents under that directory will be published.
Also note, it is recommended that you supply a class name as the second
parameter to the method (e.g. publishAsset($assetPath,__CLASS__) ).
By doing so, you avoid the issue that child classes may not work properly
because the asset path will be relative to the directory containing the child class file.
publishFilePath()
публичный Метод
Publishes a file or directory and returns its URL.