Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
SimpleViewAsyncController.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\controllers
;
4
14
abstract
class
SimpleViewAsyncController
extends
SimpleViewController
{
15
protected
static
$views
= [ ];
16
17
protected
function
_includeFileAsString
($filename, $pdata) {
18
$key = \md5 ( \json_encode ( $pdata ) );
19
if
(! isset ( self::$views [$filename] [$key] )) {
20
if
(isset ( $pdata )) {
21
\extract ( $pdata );
22
}
23
\ob_start ();
24
include ($filename);
25
return
self::$views [$filename] [$key] = \ob_get_clean ();
26
}
27
return
self::$views [$filename] [$key];
28
}
29
41
public
function
loadView
(
string
$viewName, $pData = NULL,
bool
$asString =
false
) {
42
$filename = \ROOT . \DS .
'views'
. \DS . $viewName;
43
if
($asString) {
44
return
$this->
_includeFileAsString
( $filename, $pData );
45
}
46
echo $this->
_includeFileAsString
( $filename, $pData );
47
}
48
}
Ubiquity\controllers\SimpleViewAsyncController
Default controller displaying php views only with an async server (Swoole, workerman).
Definition
SimpleViewAsyncController.php:14
Ubiquity\controllers\SimpleViewAsyncController\loadView
loadView(string $viewName, $pData=NULL, bool $asString=false)
Loads the php view $viewName possibly passing the variables $pdata.
Definition
SimpleViewAsyncController.php:41
Ubiquity\controllers\SimpleViewAsyncController\$views
static $views
Definition
SimpleViewAsyncController.php:15
Ubiquity\controllers\SimpleViewAsyncController\_includeFileAsString
_includeFileAsString($filename, $pdata)
Definition
SimpleViewAsyncController.php:17
Ubiquity\controllers\SimpleViewController
Default controller displaying php views only.
Definition
SimpleViewController.php:14
Ubiquity\controllers
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
controllers
SimpleViewAsyncController.php
Generated on Sun Dec 10 2023 15:04:19 for
Ubiquity
by
doxygen
1.9.8