本文整理匯總了PHP中Tpl::_get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tpl::_get方法的具體用法?PHP Tpl::_get怎麽用?PHP Tpl::_get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tpl
的用法示例。
在下文中一共展示了Tpl::_get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array_merge
* GNU Lesser General Public License along with OpenLSS.
* If not, see <http://www.gnu.org/licenses/>.
*/
use LSS\Account\Client;
use LSS\Account\ClientSession;
use LSS\Config;
use LSS\Url;
if (session_id() != '') {
//check for session
try {
if (ClientSession::checkLogin()) {
//register session
$token = ClientSession::fetchByToken(ClientSession::getTokenFromSession());
$session = array_merge(Client::fetch($token['staff_id']), $token);
ClientSession::storeSession($session);
unset($session, $token);
//set tpl globals (if Tpl is available)
if (is_callable(array('Tpl', '_get'))) {
Tpl::_get()->set(array('client_name' => ClientSession::get('name'), 'client_lastlogin' => date(Config::get('account.date.general_format'), ClientSession::get('last_login'))));
}
} else {
if (server('REQUEST_URI') != Url::login()) {
redirect(Url::login());
}
}
} catch (Exception $e) {
ClientSession::tokenDestroy(ClientSession::getTokenFromSession());
ClientSession::destroySession();
redirect(Url::login());
}
}
示例2: array_merge
*
* You should have received a copy of the
* GNU Lesser General Public License along with OpenLSS.
* If not, see <http://www.gnu.org/licenses/>.
*/
use LSS\Session\Staff;
use LSS\Session\StaffSession;
if (session_id() != '') {
//check for session
try {
if (StaffSession::checkLogin()) {
//register session
$token = StaffSession::fetchByToken(StaffSession::getTokenFromSession());
$session = array_merge(Staff::fetch($token['staff_id']), $token);
StaffSession::storeSession($session);
unset($session, $token);
//set tpl globals (if Tpl is available)
if (is_callable(array('Tpl', '_get'))) {
Tpl::_get()->set(array('staff_name' => StaffSession::get('name'), 'staff_lastlogin' => date(Config::get('account.date.general_format'), StaffSession::get('last_login'))));
}
} else {
if (server('REQUEST_URI') != Url::login()) {
redirect(Url::login());
}
}
} catch (Exception $e) {
StaffSession::tokenDestroy(StaffSession::getTokenFromSession());
StaffSession::destroySession();
redirect(Url::login());
}
}