当前位置: 首页>>代码示例>>PHP>>正文


PHP CopixUrl::appendToUrl方法代码示例

本文整理汇总了PHP中CopixUrl::appendToUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP CopixUrl::appendToUrl方法的具体用法?PHP CopixUrl::appendToUrl怎么用?PHP CopixUrl::appendToUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CopixUrl的用法示例。


在下文中一共展示了CopixUrl::appendToUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processLaunch

 /**
  *
  */
 public function processLaunch()
 {
     //Si aucun test n'est donné, on redirige vers la page de choix
     if (($test = _request('tests')) === null) {
         return _arRedirect(_url('unittest|'));
     }
     //Si on a demandé à lancer les tests avec Ajax, on génère le template d'appel pour chaque élément
     if (_request('ajax')) {
         $ppo = new CopixPpo();
         $ppo->TITLE_PAGE = 'Lancements des tests unitaires';
         $ppo->arTests = $this->_getTest();
         return _arPpo($ppo, 'tests.launch.php');
     } else {
         //on a pas demandé d'appel type ajax, donc on lance directement les tests demandés.
         if (CopixAjax::isAJAXRequest()) {
         } else {
             //C'est une demande normale, la réponse sera de type HTML
             $more = '';
         }
     }
     //On lance enfin la demande de test
     $httpClientRequest = new CopixHTTPClientRequest(CopixUrl::appendToUrl(_url() . 'test.php', array('tests' => $test, 'xml' => CopixAjax::isAJAXRequest())));
     $httpClient = new CopixHttpClient();
     $response = $httpClient->launch($httpClientRequest);
     return _arContent($response[0]->getBody(), array('content-type' => 'text/html'));
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:29,代码来源:unittest.actiongroup.php

示例2: smarty_function_copixurl

/**
* Plugin smarty type fonction
* Purpose:  generation of a copixed url
*
* Input:    dest=module|desc|action
*           complete syntax will be:
*           desc|action for current module, desc and action
*           [action or |action] default desc, action
*           [|desc|action] project, desc and action
*           [||action] action in the project
*           [module||action] action in the default desc for the module
*           [|||] the only syntax for the current page
*
*           * = any extra params will be used to generate the url
*
*/
function smarty_function_copixurl($params, &$me)
{
    if (isset($params['notxml'])) {
        $isxml = $params['notxml'] == 'true' ? false : true;
        unset($params['notxml']);
    } else {
        $isxml = true;
    }
    $assign = '';
    if (isset($params['assign'])) {
        $assign = $params['assign'];
        unset($params['assign']);
    }
    if (!isset($params['dest']) && !isset($params['appendFrom'])) {
        $toReturn = _url(null, array(), $isxml);
    }
    if (isset($params['appendFrom'])) {
        $appendFrom = $params['appendFrom'];
        unset($params['appendFrom']);
        $toReturn = CopixUrl::appendToUrl($appendFrom, $params, $isxml);
    }
    if (isset($params['dest'])) {
        $dest = $params['dest'];
        unset($params['dest']);
        $toReturn = _url($dest, $params, $isxml);
    }
    if (strlen($assign) > 0) {
        $me->assign($assign, $toReturn);
        return '';
    } else {
        return $toReturn;
    }
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:49,代码来源:function.copixurl.php

示例3: smarty_function_copixurl

/**
* Plugin smarty type fonction
* Purpose:  generation of a copixed url
*
* Input:    dest=module|desc|action
*           complete syntax will be:
*           desc|action for current module, desc and action
*           [action or |action] default desc, action
*           [|desc|action] project, desc and action
*           [||action] action in the project
*           [module||action] action in the default desc for the module
*           [|||] the only syntax for the current page
*
*           * = any extra params will be used to generate the url
*
*/
function smarty_function_copixurl($params, &$this)
{
    if (isset($params['notxml'])) {
        $isxml = $params['notxml'] == 'true' ? false : true;
        unset($params['notxml']);
    } else {
        $isxml = true;
    }
    $assign = '';
    if (isset($params['assign'])) {
        $assign = $params['assign'];
        unset($params['assign']);
    }
    if (!isset($params['dest']) && !isset($params['appendFrom'])) {
        $toReturn = CopixUrl::get(null, array(), $isxml);
    }
    /*
        $tabUrl = explode ('|', $params['dest']);
        $urlParams = array ();
        switch (count ($tabUrl)){
            case 1:
            $urlParams = array ('module'=>CopixContext::get (), 'desc'=>'default', 'action'=>$tabUrl[0]);
            break;
    
            case 2:
            $urlParams = array ('module'=>CopixContext::get (), 'desc'=>$tabUrl[0], 'action'=>$tabUrl[1]);
            break;
    
            case 3:
            $urlParams = array ('module'=>$tabUrl[0], 'desc'=>$tabUrl[1], 'action'=>$tabUrl[2]);
            break;
    
            default :
            $urlParams = array ();
        }
    */
    //checking parameters
    /*
    $urlParams = array ();
    if ($module != ''){
    $urlParams['module'] = $module;
    }
    if ($desc != ''){
    $urlParams['desc'] = $desc;
    }
    if ($action != ''){
    $urlParams['action'] = $action;
    }
    */
    if (isset($params['appendFrom'])) {
        $appendFrom = $params['appendFrom'];
        unset($params['appendFrom']);
        $toReturn = CopixUrl::appendToUrl($appendFrom, $params, $isxml);
    }
    if (isset($params['dest'])) {
        $dest = $params['dest'];
        unset($params['dest']);
        $toReturn = CopixUrl::get($dest, $params, $isxml);
    }
    if (strlen($assign) > 0) {
        $this->assign($assign, $toReturn);
        return '';
    } else {
        return $toReturn;
    }
}
开发者ID:BackupTheBerlios,项目名称:phpannu-svn,代码行数:82,代码来源:function.copixurl.php

示例4: testParams

 public function testParams()
 {
     $pUrl = 'test.php';
     $pUrlParam = 'test.php?param=value';
     $pUrlParams = 'test.php?param1=1&param2=2&param3=3';
     $pUrlParamsXml = 'test.php?param1=1&param2=2&param3=3';
     // Test des extrctions de paramètres
     $this->assertEquals(CopixUrl::extractParams($pUrl, false), array());
     $this->assertEquals(CopixUrl::extractParams($pUrlParam, false), array('param' => 'value'));
     $this->assertEquals(CopixUrl::extractParams($pUrlParam, true), array('param' => 'value'));
     $this->assertEquals(CopixUrl::extractParams($pUrlParams, false), array('param1' => 1, 'param2' => 2, 'param3' => 3));
     $this->assertEquals(CopixUrl::extractParams($pUrlParamsXml, true), array('param1' => 1, 'param2' => 2, 'param3' => 3));
     // Test des suppressions de paramètres
     $this->assertEquals(CopixUrl::removeParams($pUrl, array('param1')), $pUrl);
     $this->assertEquals(CopixUrl::removeParams($pUrlParam, array('param')), $pUrl);
     $this->assertEquals(CopixUrl::removeParams($pUrlParams, array('param1')), 'test.php?param2=2&param3=3');
     $this->assertEquals(CopixUrl::removeParams($pUrlParams, array('param2')), 'test.php?param1=1&param3=3');
     $this->assertEquals(CopixUrl::removeParams($pUrlParams, array('param3')), 'test.php?param1=1&param2=2');
     $this->assertEquals(CopixUrl::removeParams($pUrlParamsXml, array('param1'), true), 'test.php?param2=2&param3=3');
     $this->assertEquals(CopixUrl::removeParams($pUrlParamsXml, array('param2'), true), 'test.php?param1=1&param3=3');
     $this->assertEquals(CopixUrl::removeParams($pUrlParamsXml, array('param3'), true), 'test.php?param1=1&param2=2');
     // Test des ajout de paramètres
     $this->assertEquals(CopixUrl::appendToUrl($pUrl), $pUrl);
     $this->assertEquals(CopixUrl::appendToUrl($pUrl, array('param' => 'value')), $pUrlParam);
     $this->assertEquals(CopixUrl::appendToUrl($pUrl, array('param1' => '1', 'param2' => '2', 'param3' => '3')), $pUrlParams);
     $this->assertEquals(CopixUrl::appendToUrl($pUrl, array('param1' => '1', 'param2' => '2', 'param3' => '3'), true), $pUrlParamsXml);
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:27,代码来源:copixtest_copixurltest.class.php


注:本文中的CopixUrl::appendToUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。