public static function getPostMailAddress($route, $params = array())
 {
     $configuration = sfContext::getInstance()->getConfiguration();
     $configPath = sfConfig::get('sf_plugins_dir') . '/opCommunityWikiPlugin/apps/mobile_mail_frontend/config/routing.yml';
     $routing = new opMailRouting(new sfEventDispatcher());
     $config = new sfRoutingConfigHandler();
     $routes = $config->evaluate(array($configPath));
     $routing->setRoutes(array_merge(sfContext::getInstance()->getRouting()->getRoutes(), $routes));
     return $routing->generate($route, $params);
 }
Exemplo n.º 2
0
function op_mail_to($route, $params = array(), $name = '', $options = array(), $default_value = array())
{
    $configuration = sfContext::getInstance()->getConfiguration();
    $configPath = '/mobile_mail_frontend/config/routing.yml';
    $files = array_merge(array(sfConfig::get('sf_apps_dir') . $configPath), $configuration->globEnablePlugin('/apps' . $configPath));
    $user = sfContext::getInstance()->getUser();
    if (sfConfig::get('op_is_mail_address_contain_hash') && $user->hasCredential('SNSMember')) {
        $params['hash'] = $user->getMember()->getMailAddressHash();
    }
    $routing = new opMailRouting(new sfEventDispatcher());
    $config = new sfRoutingConfigHandler();
    $routes = $config->evaluate($files);
    $routing->setRoutes(array_merge(sfContext::getInstance()->getRouting()->getRoutes(), $routes));
    return mail_to($routing->generate($route, $params), $name, $options, $default_value);
}