本文整理汇总了PHP中Q_Response::addTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Response::addTemplate方法的具体用法?PHP Q_Response::addTemplate怎么用?PHP Q_Response::addTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Response
的用法示例。
在下文中一共展示了Q_Response::addTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Streams_after_Q_objects
function Streams_after_Q_objects()
{
$user = Users::loggedInUser();
if (!$user) {
return;
}
$invite = Streams::$followedInvite;
if (!$invite) {
return;
}
$displayName = $user->displayName();
if ($displayName) {
return;
}
$stream = new Streams_Stream();
$stream->publisherId = $invite->publisherId;
$stream->name = $invite->streamName;
if (!$stream->retrieve()) {
throw new Q_Exception_MissingRow(array('table' => 'stream', 'criteria' => 'with that name'), 'streamName');
}
// Prepare the complete invite dialog
$invitingUser = Users_User::fetch($invite->invitingUserId);
list($relations, $related) = Streams::related($user->id, $stream->publisherId, $stream->name, false);
$params = array('displayName' => null, 'action' => 'Streams/basic', 'icon' => $user->iconUrl(), 'token' => $invite->token, 'user' => array('icon' => $invitingUser->iconUrl(), 'displayName' => $invitingUser->displayName(array('fullAccess' => true))), 'stream' => $stream->exportArray(), 'relations' => Db::exportArray($relations), 'related' => Db::exportArray($related));
$config = Streams_Stream::getConfigField($stream->type, 'invite', array());
$defaults = Q::ifset($config, 'dialog', array());
$tree = new Q_Tree($defaults);
if ($tree->merge($params)) {
$dialogData = $tree->getAll();
if ($dialogData) {
Q_Response::setScriptData('Q.plugins.Streams.invite.dialog', $dialogData);
Q_Response::addTemplate('Streams/invite/complete');
}
}
}