An abstract page.
More...
|
| getClass () |
| Returns new \ReflectionClass($this) .
|
|
| getPageName () |
| Returns short class name without 'Page' suffix.
|
|
| show () |
| Handles a server request and displays this page.
|
|
An abstract page.
- Author
- Alexey Vaskovsky
Definition at line 23 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::authorize |
( |
| ) |
|
|
protected |
Performs authorization.
- Returns
- true if user is authorized; false otherwise.
Definition at line 266 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::authorizeByAttribute |
( |
|
$attribute | ) |
|
|
protected |
Performs authorization by the account attribute.
- Parameters
-
string | $attribute | is an account attribute name. |
- Returns
- true if user is authorized; false otherwise.
- See also
- authorize()
Definition at line 280 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::authorizeByPageName |
( |
array |
$public_pages = array() | ) |
|
|
protected |
Performs authorization by the page name.
- Parameters
-
array | $public_pages | are list of page names. |
- Returns
- true if user is authorized; false otherwise.
- See also
- authorize()
Definition at line 299 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::getApplicationFile |
( |
|
$filename | ) |
|
|
finalprotected |
Returns a file path relative to the application directory.
- Parameters
-
string | $filename | is a file name. |
- Exceptions
-
InvalidArgumentException | if $filename is empty. |
Definition at line 96 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::getApplicationURL |
( |
|
$path | ) |
|
|
finalprotected |
Returns a path relative to the application URL.
- Parameters
-
string | $path | is a relative path. |
- Exceptions
-
InvalidArgumentException | if $path is null. |
Definition at line 53 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::getAuthentication |
( |
| ) |
|
|
finalprotected |
AVaskovsky\WebApplication\AbstractPage::getPDO |
( |
| ) |
|
|
finalprotected |
Returns a PDO connection.
- Exceptions
-
PDOException | if a database access error occurs. |
- See also
- openPDO()
Definition at line 225 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::openPDO |
( |
|
$dsn, |
|
|
|
$user = "" , |
|
|
|
$password = "" |
|
) |
| |
|
finalprotected |
Opens a database connection to use in this application.
- Parameters
-
string | $dsn | is a string that contains the information required to connect to the database. |
string | $user | is a user name for the DSN string. |
string | $password | is a password for the DSN string. |
- Exceptions
-
PDOException | if a database access error occurs. |
InvalidArgumentException | : if $dsn is empty; if $user is null; if $password is null. |
Definition at line 188 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::render |
( |
|
$template, |
|
|
array |
$view_data = array() , |
|
|
|
$code = 200 |
|
) |
| |
|
protected |
Renders a view.
- Parameters
-
string | $template | is a template name. |
array | $view_data | is an associative array that contains a view data. |
int | $code | is an HTTP status code. |
- Exceptions
-
InvalidArgumentException | : if $template is empty; if $code is out of the bounds 100..599. |
- Returns
- a string; never null.
Definition at line 328 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::renderError |
( |
|
$message, |
|
|
|
$code = 500 |
|
) |
| |
|
protected |
Renders an error.
- Parameters
-
string | $message | is an error message. |
int | $code | is an HTTP status code. |
- Exceptions
-
InvalidArgumentException | : if $message is null; if $code is out of the bounds 100..599. |
- Returns
- a string; never null.
Definition at line 364 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::renderException |
( |
\Exception |
$ex | ) |
|
|
protected |
Renders an exception.
- Parameters
-
Exception | $ex | is an exception. |
- Returns
- a string; never null.
Definition at line 391 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::setApplicationDirectory |
( |
|
$directory | ) |
|
|
finalprotected |
Sets the application directory.
- Parameters
-
string | $directory | is a directory name. |
- Exceptions
-
InvalidArgumentException | if $directory is empty. |
Definition at line 78 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::setApplicationURL |
( |
|
$url | ) |
|
|
finalprotected |
Sets the application URL.
- Parameters
-
string | $url | is the application URL. |
- Exceptions
-
InvalidArgumentException | if $url is null. |
Definition at line 36 of file AbstractPage.php.
Sets an authentication to use with this page.
- Parameters
-
- Exceptions
-
InvalidArgumentException | if $auth is null. |
Definition at line 243 of file AbstractPage.php.
AVaskovsky\WebApplication\AbstractPage::setLocale |
( |
|
$locale | ) |
|
|
protected |
Sets a locale to use with this page.
- Parameters
-
string | $locale | is the locale name. |
- Exceptions
-
InvalidArgumentException | if $locale is empty. |
Definition at line 152 of file AbstractPage.php.
The documentation for this class was generated from the following file: