本文整理汇总了PHP中app_url_for函数的典型用法代码示例。如果您正苦于以下问题:PHP app_url_for函数的具体用法?PHP app_url_for怎么用?PHP app_url_for使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了app_url_for函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequestToken
public function getRequestToken()
{
$api = new opCalendarApi($this->consumer, null, opCalendarApiHandler::GET, self::REQUEST_TOKEN_ENDPOINT, array('oauth_callback' => app_url_for('pc_frontend', '@calendar_api_callback', true), 'scope' => self::SCOPE));
$api->setIsUseAuthorizedHeader(false);
$handler = new opCalendarApiHandler($api, new opCalendarApiResultsStr());
return $handler->execute();
}
示例2: createEntryByInstance
public function createEntryByInstance(Doctrine_Record $diary, SimpleXMLElement $entry = null)
{
$entry = parent::createEntryByInstance($diary, $entry);
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'opUtil'));
$entry->setTitle($diary->getTitle());
$entry->setContent($diary->getBody());
$entry->setAuthorByMember($diary->getMember());
$entry->setLink(app_url_for('pc_frontend', '@diary_show?id=' . $diary->getId(), true), 'self', 'alternate');
$entry->setLink(app_url_for('mobile_frontend', '@diary_show?id=' . $diary->getId(), true), 'self', 'alternate');
return $entry;
}
示例3: get_auther_name
/**
* opCalendarHelper
*
* @package OpenPNE
* @subpackage helper
* @author Shinichi Urabe <urabe@tejimaya.com>
*/
function get_auther_name($schedule_resource, $link_profile_page = false)
{
if ($schedule_resource->member_id) {
$member = $schedule_resource->Member;
$value = $link_profile_page ? link_to($member->name, app_url_for('pc_frontend', '@member_profile?id=' . $member->id), array('target' => '_blank')) : $member->name;
return sprintf('[user] %s', $value);
}
if ($schedule_resource->admin_user_id) {
return sprintf('[admin] %s', $schedule_resource->AdminUser->username);
}
return '';
}
示例4: op_api_community
function op_api_community($community)
{
$viewMemberId = sfContext::getInstance()->getUser()->getMemberId();
$communityUrl = app_url_for('pc_frontend', array('sf_route' => 'community_home', 'id' => $community->getId()), true);
$communityImageFileName = $community->getImageFileName();
if (!$communityImageFileName) {
$communityImage = op_image_path('no_image.gif', true);
} else {
$communityImage = sf_image_path($communityImageFileName, array('size' => '48x48'), true);
}
$communityMember = Doctrine::getTable('CommunityMember')->retrieveByMemberIdAndCommunityId($viewMemberId, $community->getId());
return array('id' => $community->getId(), 'name' => $community->getName(), 'category' => $community->getCommunityCategory() ? $community->getCommunityCategory()->getName() : null, 'community_url' => $communityUrl, 'community_image_url' => $communityImage, 'joining' => $communityMember ? !$communityMember->getIsPre() : false, 'admin' => $communityMember ? $communityMember->hasPosition('admin') : false, 'sub_admin' => $communityMember ? $communityMember->hasPosition('sub_admin') : false, 'created_at' => op_api_date($community->getCreatedAt()), 'admin_member' => op_api_member($community->getAdminMember()), 'member_count' => $community->countCommunityMembers(), 'public_flag' => $community->getConfig('public_flag'), 'register_policy' => $community->getConfig('register_policy'), 'description' => $community->getConfig('description'));
}
示例5: createEntryByInstance
public function createEntryByInstance(Doctrine_Record $event, SimpleXMLElement $entry = null)
{
$entry = parent::createEntryByInstance($event, $entry);
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'opUtil'));
$entry->setTitle($event->getName());
$entry->setContent($event->getBody());
$entry->setAuthorByMember($event->getMember());
$this->addWhenElement($entry->getElements(), date('c', strtotime($event->getOpenDate())));
$this->addWhereElement($entry->getElements(), $event->getArea());
$entry->setLink(url_for('@feeds_community_event_retrieve_resource_normal?model=communityEvent&id=' . $event->getId()), 'self', 'application/atom+xml');
$entry->setLink(app_url_for('pc_frontend', 'communityEvent/detail?id=' . $event->getId(), true), 'alternate', 'text/html');
$entry->setLink(app_url_for('mobile_frontend', 'communityEvent/detail?id=' . $event->getId(), true), 'alternate');
return $entry;
}
示例6: op_timeline_plugin_screen_name
function op_timeline_plugin_screen_name($body, $options = array())
{
preg_match_all('/(@+)([-_0-9A-Za-z]+)/', $body, $matches);
if ($matches) {
$i = 0;
foreach ($matches[2] as $screenName) {
$member = Doctrine::getTable('MemberConfig')->findOneByNameAndValue('op_screen_name', $screenName);
if ($member) {
$memberId = $member->getMemberId();
$link = link_to('@' . $screenName, app_url_for('pc_frontend', array('sf_route' => 'obj_member_profile', 'id' => $memberId), true), array('target' => '_blank'));
$mention = '/' . $matches[0][$i] . '/';
$body = preg_replace($mention, $link, $body);
}
$i++;
}
}
return $body;
}
示例7: createEntryByInstance
public function createEntryByInstance(Doctrine_Record $communityMember, SimpleXMLElement $entry = null)
{
$member = $communityMember->getMember();
$entry = parent::createEntryByInstance($communityMember, $entry);
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'opUtil'));
$entry->setTitle($member->getName());
$content = $entry->getElements()->addChild('content');
$content->addAttribute('type', 'xhtml');
$profiles = $content->addChild('div');
$profiles->addAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
foreach ($member->getProfiles() as $profile) {
$value = (string) $profile;
$child = $profiles->addChild('div', $value);
$child->addAttribute('id', $profile->getName());
}
$entry->setLink(url_for('@feeds_member_retrieve_resource_normal?model=community&id=' . $member->getId()), 'self', 'application/atom+xml');
$entry->setLink(app_url_for('pc_frontend', 'member/profile?id=' . $member->getId(), true), 'alternate', 'text/html');
$entry->setLink(app_url_for('mobile_frontend', 'member/profile?id=' . $member->getId(), true), 'alternate');
return $entry;
}
示例8: sendNotificationMail
public static function sendNotificationMail(Community $community, $id, $type, $nickname, $subject, $body)
{
if (version_compare(OPENPNE_VERSION, '3.6beta1-dev', '<')) {
return null;
}
sfContext::getInstance()->getConfiguration()->loadHelpers(array('opUtil'));
$params = array('community_name' => $community->getName(), 'wiki_name' => $subject, 'nickname' => $nickname, 'body' => $body);
$rs = Doctrine::getTable('CommunityMember')->createQuery()->where('community_id = ?', array($community->getId()))->andWhere('is_receive_mail_pc = ? OR is_receive_mail_mobile = ?', array(true, true))->execute(array(), Doctrine::HYDRATE_ON_DEMAND);
foreach ($rs as $r) {
$member = $r->getMember();
$memberPcAddress = $member->getConfig('pc_address');
$memberMobileAddress = $member->getConfig('mobile_address');
$from = self::getPostMailAddress('mail_community_' . $type . '_comment_create', array('id' => $id, 'hash' => $member->getMailAddressHash()));
if ($r->getIsReceiveMailPc() && $memberPcAddress) {
$params['url'] = app_url_for('pc_frontend', '@community' . ucfirst($type) . '_show?id=' . $id, true);
opMailSend::sendTemplateMail('notifyCommunityPosting', $memberPcAddress, $from, $params);
}
if ($r->getIsReceiveMailMobile() && $memberMobileAddress) {
$params['url'] = app_url_for('mobile_frontend', '@community' . ucfirst($type) . '_show?id=' . $id, true);
opMailSend::sendTemplateMail('notifyCommunityPosting', $memberMobileAddress, $from, $params);
}
}
}
示例9: __
<?php
echo __('When mobile information registration is done from following URL, the member registration is completed.');
?>
<?php
echo app_url_for('mobile_frontend', 'member/registerMobileToRegisterEnd?token=' . $token . '&id=' . $id, true);
示例10: __
if (!$sf_user->isAuthenticated()) {
?>
class="insecure"<?php
}
?>
>
<div id="wrap">
<div id="contents" class="clearfix">
<div id="header">
<h1><?php
echo __('%sns% Administration', array('%sns%' => $op_config['sns_name']));
?>
</h1>
<span id="visit-site"><a href="<?php
echo app_url_for('pc_frontend', '@homepage', true);
?>
" target="_blank"><?php
echo __('Visit Site');
?>
</a></span>
</div>
<?php
if ($sf_user->isAuthenticated()) {
?>
<div id="menu">
<ul>
<li><?php
echo link_to(__('Top page'), '@homepage');
?>
示例11: __
<?php
echo __('We accepted your recovering password request.');
?>
<?php
echo __('Please click the following URL and complete password recovery process.');
?>
<?php
echo app_url_for('pc_frontend', 'opAuthMailAddress/passwordRecoveryComplete?token=' . $token . '&id=' . $id, true);
示例12: getOAuthConsumerKey
/**
* get consumer key for RSA-SHA1
*
* @return OAuthConsumer
*/
public static function getOAuthConsumerKey()
{
sfContext::getInstance()->getConfiguration()->loadHelpers(array('opUtil'));
$baseUrl = sfConfig::get('op_base_url');
if ('/' === substr($baseUrl, -1)) {
$baseUrl = substr($baseUrl, 0, strlen($baseUrl) - 1);
}
return $baseUrl . app_url_for('pc_frontend', '@opensocial_certificates');
}
示例13: include_http_metas
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<?php
include_http_metas();
include_metas();
include_title();
op_smt_use_stylesheet('bootstrap');
op_smt_use_stylesheet('smt_main');
op_smt_include_stylesheets();
?>
<meta name="viewport" content="width=320px,user-scalable=no" />
<?php
if (opConfig::get('enable_jsonapi') && opToolkit::isSecurePage()) {
$jsonData = array('apiKey' => opToolkit::isSecurePage() ? $sf_user->getMemberApiKey() : '', 'apiBase' => app_url_for('api', 'homepage'));
$json = defined('JSON_PRETTY_PRINT') ? json_encode($jsonData, JSON_PRETTY_PRINT) : json_encode($jsonData);
echo javascript_tag('
var openpne = ' . $json . ';
');
}
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_notify');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php
示例14: include_http_metas
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<?php
include_http_metas();
include_metas();
include_title();
op_smt_use_stylesheet('bootstrap');
op_smt_use_stylesheet('smt_main');
op_smt_include_stylesheets();
?>
<meta name="viewport" content="width=320px,user-scalable=no" />
<?php
if (opConfig::get('enable_jsonapi') && opToolkit::isSecurePage()) {
$jsonData = array('apiKey' => opToolkit::isSecurePage() ? $sf_user->getMemberApiKey() : '', 'apiBase' => app_url_for('api', 'homepage'), 'baseUrl' => $sf_request->getRelativeUrlRoot() . '/');
echo javascript_tag('
var openpne = ' . json_encode($jsonData) . ';
');
}
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_notify');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php
printf('page_%s_%s', $this->getModuleName(), $this->getActionName());
示例15: __
?>
<?php
echo __('We suggest you to send birthday message to your friend.');
?>
<?php
echo __('Birthday');
?>
: <?php
echo op_format_date(strtotime($birthMember->getProfile('op_preset_birthday')), 'XShortDateJa');
?>
<?php
echo __('%nickname%', array('%nickname%' => $op_term['nickname']->titleize()));
?>
: <?php
echo $birthMember->name;
?>
<?php
echo __('URL');
?>
: <?php
echo sfConfig::get('op_base_url') . app_url_for('pc_frontend', 'member/profile?id=' . $birthMember->id);
?>
<?php
echo __('We hope that using %1% is useful for your future.', array('%1%' => $op_config['sns_name']));