Exemplo n.º 1
0
 public function testHelperEqualsAbsoluteInternal()
 {
     Yii::$app->request->baseUrl = '';
     Yii::$app->request->scriptUrl = '';
     Yii::$app->composition->hidden = true;
     $this->assertEquals(Url::to(['/admin/login/index'], true), Url::toInternal(['admin/login/index'], true));
     Yii::$app->composition->hidden = false;
     $this->assertEquals(Url::to(['/admin/login/index'], true), Url::toInternal(['admin/login/index'], true));
 }
 /**
  * Get the Payment Gateway Notify link.
  *
  * This method is used to retrieve the link for dispatching to the requested url.
  *
  * @return string
  */
 public function getTransactionGatewayNotifyLink()
 {
     return Url::toInternal(['/payment/default/notify', 'lpToken' => $this->model->auth_token, 'lpKey' => $this->model->random_key], true);
 }
Exemplo n.º 3
0
                        <div class="git pull-right">
                            <a href="https://github.com/zephir/luya" target="_blank" alt="Luya on GitHub" title="Luya on GitHub"><i class="fa fa-github fa-2x"></i></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- You can delete this line in your template! as this is only a luya information. -->
        <div style="padding:20px; background-color:#9ccc65; margin-top:20px;" class="container">
            <div>
                <?php 
echo \luya\Module::t('luya', 'kickstarter_success');
?>
                <?php 
echo \luya\Module::t('luya', 'kickstarter_admin_link', ['link' => \luya\helpers\Url::toInternal(['admin/default/index']), true]);
?>
            </div>
        </div>
        
        <div class="container" id="content">
            <div class="row">
                <ol class="breadcrumb">
                    <?php 
foreach (Yii::$app->menu->current->teardown as $item) {
    ?>
                    <li><a href="<?php 
    echo $item->link;
    ?>
"><?php 
    echo $item->title;
Exemplo n.º 4
0
 public function testModuleContextOtherModuleAbsoluteUrls()
 {
     Yii::$app->request->baseUrl = '';
     Yii::$app->request->scriptUrl = '';
     Yii::$app->urlManager->contextNavItemId = 11;
     $this->assertEquals('http://localhost/en/admin/login', Url::toManager('admin/login/index', [], true));
     $this->assertEquals('http://localhost/en/admin/login', Url::to(['/admin/login/index'], true));
     $this->assertEquals('http://localhost/en/admin/login', Url::toRoute(['/admin/login/index'], true));
     $this->assertEquals('http://localhost/en/admin/login', Url::toInternal(['/admin/login/index'], true));
     Yii::$app->urlManager->contextNavItemId = 1;
     $url = Url::toManager('news/default/detail', ['id' => 1, 'title' => 'foo-bar'], true);
     $this->assertEquals('http://localhost/1/foo-bar', $url);
     Yii::$app->urlManager->contextNavItemId = 2;
     $url = Url::toManager('news/default/detail', ['id' => 1, 'title' => 'foo-bar'], true);
     $this->assertEquals('http://localhost/en/page-1/1/foo-bar', $url);
     Yii::$app->urlManager->contextNavItemId = 2;
     $url = Url::toManager('news/default/detail', ['id' => 1, 'title' => 'foo-bar', 'pa' => 'ram'], true);
     $this->assertEquals('http://localhost/en/page-1/1/foo-bar?pa=ram', $url);
     Yii::$app->urlManager->contextNavItemId = 1;
     $url = Url::toManager('news/default/detail', ['id' => 1, 'title' => 'page-2-news-title', 'news' => 'page'], true);
     $this->assertEquals('http://localhost/1/page-2-news-title?news=page', $url);
 }
Exemplo n.º 5
0
        
    <div style="margin-top:70px;"></div>
        
        
        
    <div class="container" id="content">
    
        <!-- /* DELETE ME -->    
        <div class="row" style="margin-bottom: 20px;">
            <div class="col-md-12">
                <div style="background-color:#9ccc65;" class="jumbotron">
                        <?php 
echo Yii::t('app', 'kickstarter_success');
?>
                        <?php 
echo Yii::t('app', 'kickstarter_admin_link', ['link' => Url::toInternal(['admin/default/index']), true]);
?>
                </div>
            </div>
        </div>
        <!-- DELETE ME */ -->
        
        <div class="row">
            <div class="col-md-12">
                <ol class="breadcrumb">
                    <?php 
foreach (Yii::$app->menu->current->teardown as $item) {
    ?>
                    <li><a href="<?php 
    echo $item->link;
    ?>