本文整理汇总了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());
}
}