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


PHP link_to_unless函数代码示例

本文整理汇总了PHP中link_to_unless函数的典型用法代码示例。如果您正苦于以下问题:PHP link_to_unless函数的具体用法?PHP link_to_unless怎么用?PHP link_to_unless使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_sympal_pager_navigation

/**
 * Get the navigation links for given sfDoctrinePager instance
 *
 * @param sfDoctrinePager $pager
 * @param string $uri  The uri to prefix to the links
 * @return string $html
 */
function get_sympal_pager_navigation($pager, $uri, $requestKey = 'page')
{
    sympal_use_stylesheet('/sfSympalPlugin/css/pager.css');
    $navigation = '<div class="sympal_pager_navigation">';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . $requestKey . '=';
        // First and previous page
        if ($pager->getPage() != 1) {
            $navigation .= link_to(image_tag('/sf/sf_admin/images/first.png', 'align=absmiddle'), $uri . '1');
            $navigation .= link_to(image_tag('/sf/sf_admin/images/previous.png', 'align=absmiddle'), $uri . $pager->getPreviousPage()) . ' ';
        }
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = '<span>' . link_to_unless($page == $pager->getPage(), $page, $uri . $page) . '</span>';
        }
        $navigation .= join('  ', $links);
        // Next and last page
        if ($pager->getPage() != $pager->getLastPage()) {
            $navigation .= ' ' . link_to(image_tag('/sf/sf_admin/images/next.png', 'align=absmiddle'), $uri . $pager->getNextPage());
            $navigation .= link_to(image_tag('/sf/sf_admin/images/last.png', 'align=absmiddle'), $uri . $pager->getLastPage());
        }
    }
    $navigation .= '</div>';
    return $navigation;
}
开发者ID:RafalJachimczyk,项目名称:sympal,代码行数:33,代码来源:SympalPagerHelper.php

示例2: pager_navigation2

function pager_navigation2($pager, $uri, $navuri)
{
    $navigation = '';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . 'page=';
        // First and previous page
        if ($pager->getPage() != 1) {
            /*
            $navigation .= link_to_remote(image_tag('first.gif', 'align=absmiddle'), array(
              'url'     =>   $uri.'1',
              'update'  =>  array('success' => 'table_swipers'),
              'loading' => "Element.show('indicator')",
              'complete'=> "Element.hide('indicator');".visual_effect('highlight', 'table_swipers')));
            $navigation .= link_to_remote(image_tag('previous.gif', 'align=absmiddle'), array(
              'url'     =>  $uri.$pager->getPreviousPage(),
              'update'  =>  array('success' => 'table_swipers'),
              'loading' => "Element.show('indicator')",
              'complete'=> "Element.hide('indicator');".visual_effect('highlight', 'table_swipers')));
            */
            $navigation .= link_to(image_tag('first.gif', 'align=absmiddle'), $uri . '1');
            $navigation .= link_to(image_tag('previous.gif', 'align=absmiddle'), $uri . $pager->getPreviousPage());
        } else {
            $navigation .= image_tag('first.gif', 'align=absmiddle');
            $navigation .= image_tag('previous.gif', 'align=absmiddle');
        }
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = link_to_unless($page == $pager->getPage(), $page, $navuri . $page);
        }
        $navigation .= join('&nbsp;&nbsp;', $links);
        // Next and last page
        if ($pager->getPage() != $pager->getCurrentMaxLink()) {
            /*
            $navigation .= '&nbsp;'.link_to_remote(image_tag('next.gif', 'align=absmiddle'), array(
              'url'     =>  'home/pager?page='.$pager->getNextPage(),
              'update'  =>  array('success' => 'table_swipers'),
              'loading' => "Element.show('indicator')",
              'complete'=> "Element.hide('indicator');".visual_effect('highlight', 'swiper')));
            $navigation .= link_to_remote(image_tag('last.gif', 'align=absmiddle'), array(
              'url'     =>  'home/pager?page='.$pager->getLastPage(),
              'update'  =>  array('success' => 'table_swipers'),
              'loading' => "Element.show('indicator')",
              'complete'=> "Element.hide('indicator');".visual_effect('highlight', 'swiper')));
            */
            $navigation .= link_to(image_tag('next.gif', 'align=absmiddle'), $uri . $pager->getNextPage());
            $navigation .= link_to(image_tag('last.gif', 'align=absmiddle'), $uri . $pager->getLastPage());
        } else {
            $navigation .= '&nbsp;' . image_tag('next.gif', 'align=absmiddle');
            $navigation .= image_tag('last.gif', 'align=absmiddle');
        }
    }
    return $navigation;
}
开发者ID:sgrove,项目名称:cothinker,代码行数:54,代码来源:GlobalHelper.php

示例3: pager_navigation

function pager_navigation($pager, $uri)
{
    $navigation = '';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . 'page=';
        //$navigation .= "<div class=\"navigation\">";
        // First and previous page
        $navigation .= link_to(image_tag('/images/icons/first.png', array('align' => 'absmiddle', 'alt' => __('primero'), 'title' => __('primero'))), $uri . '1');
        $navigation .= link_to(image_tag('/images/icons/previous.png', array('align' => 'absmiddle', 'alt' => __('previo'), 'title' => __('previo'))), $uri . $pager->getPreviousPage()) . '&nbsp;';
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = link_to_unless($page == $pager->getPage(), $page, $uri . $page);
        }
        $navigation .= join('&nbsp;&nbsp;', $links);
        // Next and last page
        $navigation .= '&nbsp;' . link_to(image_tag('/images/icons/next.png', array('align' => 'absmiddle', 'alt' => __('siguiente'), 'title' => __('siguiente'))), $uri . $pager->getNextPage());
        $navigation .= link_to(image_tag('/images/icons/last.png', array('align' => 'absmiddle', 'alt' => __('último'), 'title' => __('último'))), $uri . $pager->getLastPage());
        //$navigation .= "</div>";
    }
    return $navigation;
}
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:22,代码来源:MisObjetosHelper.php

示例4: pager_navigation

function pager_navigation($pager, $uri)
{
    $navigation = '';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . 'page=';
        // First and previous page
        if ($pager->getPage() != 1) {
            $navigation .= link_to(image_tag('first.gif', 'align=absmiddle'), $uri . '1');
            $navigation .= link_to(image_tag('previous.gif', 'align=absmiddle'), $uri . $pager->getPreviousPage()) . '&nbsp;';
        }
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = link_to_unless($page == $pager->getPage(), $page, $uri . $page);
        }
        $navigation .= join('&nbsp;&nbsp;', $links);
        // Next and last page
        if ($pager->getPage() != $pager->getCurrentMaxLink()) {
            $navigation .= '&nbsp;' . link_to(image_tag('next.gif', 'align=absmiddle'), $uri . $pager->getNextPage());
            $navigation .= link_to(image_tag('last.gif', 'align=absmiddle'), $uri . $pager->getLastPage());
        }
    }
    return $navigation;
}
开发者ID:emacsattic,项目名称:symfony,代码行数:24,代码来源:GlobalHelper.php

示例5: foreach

        ?>
            <li class="<?php 
        echo $page_pk->getIsPublished() ? 'published' : 'unpublished';
        ?>
">
              <?php 
        foreach (sfPlop::get('sf_plop_cultures') as $localization) {
            ?>
                <?php 
            echo link_to(image_flag($localization, array('alt' => format_language($localization))), '@sf_plop_page_show?slug=' . $page_pk->getSlug() . '&sf_culture=' . $localization, array('class' => 'element flag w-img-link', 'title' => $page_pk->getSlug()));
            ?>
              <?php 
        }
        ?>
              <?php 
        echo link_to_unless($page->getSlug() == $page_pk->getSlug(), str_repeat('-', $page_pk->getLevel()) . ' ' . $page_pk->getSlug(), '@sf_plop_page_show?sf_culture=' . $culture . '&slug=' . $page_pk->getSlug(), array('class' => 'element', 'title' => $page_pk->getSlug()));
        ?>
              <?php 
        echo widgetIndicator($page_pk->isTemplate(), 'edit', __('This indicates if the page is a template (lock icon).', '', 'plopAdmin'), array('rel' => $page_pk->getSlug()));
        ?>
              <?php 
        echo widgetIndicator($page_pk->isPublished(), 'publish', __('This indicates if the page is published (green tick) or not (red bullet).', '', 'plopAdmin'), array('rel' => $page_pk->getSlug()));
        ?>
            </li>
          <?php 
    }
    ?>
        </ul>
      </li>
      <li class="w-menu-dd">
        <span class="element w w-edition"><?php 
开发者ID:noreiller,项目名称:sfPlopPlugin,代码行数:31,代码来源:_toolbarCMS.php

示例6: link_to

<div class="float-right">
<?php 
    if ($pager->haveToPaginate()) {
        ?>
  <?php 
        echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/first.png', 'align=absmiddle'), 'relCalendariovacunacionAlumno/list?page=1');
        ?>
  <?php 
        echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/previous.png', 'align=absmiddle'), 'relCalendariovacunacionAlumno/list?page=' . $pager->getPreviousPage());
        ?>

  <?php 
        foreach ($pager->getLinks() as $page) {
            ?>
    <?php 
            echo link_to_unless($page == $pager->getPage(), $page, 'relCalendariovacunacionAlumno/list?page=' . $page);
            ?>
  <?php 
        }
        ?>

  <?php 
        echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/next.png', 'align=absmiddle'), 'relCalendariovacunacionAlumno/list?page=' . $pager->getNextPage());
        ?>
  <?php 
        echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/last.png', 'align=absmiddle'), 'relCalendariovacunacionAlumno/list?page=' . $pager->getLastPage());
    }
    ?>
</div>
<?php 
    echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults());
开发者ID:mediasadc,项目名称:alba,代码行数:31,代码来源:listSuccess.php

示例7: link_to

	<div class="vspacer20">&nbsp;</div>
	<div id="pager">
		<?php 
if ($pager->haveToPaginate()) {
    ?>
			<?php 
    echo link_to('<img src="/images/first.png"/>', 'friend/myfriends?page=1');
    ?>
			<?php 
    echo link_to('<img src="/images/prev.png"/>', 'friend/myfriends?page=' . $pager->getPreviousPage());
    ?>
			<?php 
    foreach ($pager->getLinks() as $page) {
        ?>
				<b><?php 
        echo link_to_unless($page == $pager->getPage(), $page, 'friend/myfriends?page=' . $page, 'class="pageno"');
        ?>
</b>
				<?php 
        echo $page != $pager->getCurrentMaxLink() ? '&nbsp;' : '';
        ?>
 
			<?php 
    }
    ?>
			<?php 
    echo link_to('<img src="/images/next.png"/>', 'friend/myfriends?page=' . $pager->getNextPage());
    ?>
			<?php 
    echo link_to('<img src="/images/last.png"/>', 'friend/myfriends?page=' . $pager->getLastPage());
    ?>
开发者ID:Ayaan123,项目名称:alumnisangam,代码行数:31,代码来源:friendsSuccess.php

示例8: include_title

    <?php 
include_title();
?>
    <link rel="shortcut icon" href="/favicon.ico" />
    <?php 
include_stylesheets();
?>
    <?php 
include_javascripts();
?>
  </head>
  <body>
    <div>
      <ul>
        <li><?php 
echo link_to_unless($sf_request->getParameter('module') == 'default' && $sf_request->getParameter('action') == 'index', 'Home', '@homepage');
?>
</li>
        <li><?php 
echo link_to('View Users', '@sf_guard_profile');
?>
</li>
        <?php 
if ($sf_user->isAuthenticated()) {
    ?>
        <li><?php 
    echo link_to('Edit Profile', 'sf_guard_profile_edit', $sf_user->getGuardUser());
    ?>
</li>
        <li><?php 
    echo link_to('Signout', '@sf_guard_signout');
开发者ID:JoshuaEstes,项目名称:Office-Merit-Badges,代码行数:31,代码来源:layout.php

示例9: link_to

<?php 
if ($pager->haveToPaginate()) {
    ?>
<div class="nav">
    <?php 
    echo link_to('&laquo;', "{$iuri}&page=1");
    ?>
    <?php 
    echo link_to('&lt;', "{$iuri}&page={$pager->getPreviousPage()}");
    ?>
 
    <?php 
    foreach ($pager->getLinks() as $page) {
        ?>
        <?php 
        echo link_to_unless($page == $pager->getPage(), $page, "{$iuri}&page={$page}");
        ?>
        <?php 
        echo $page != $pager->getCurrentMaxLink() ? '-' : '';
        ?>
    <?php 
    }
    ?>
 
    <?php 
    echo link_to('&gt;', "{$iuri}&page={$pager->getNextPage()}");
    ?>
    <?php 
    echo link_to('&raquo;', "{$iuri}&page={$pager->getLastPage()}");
    ?>
</div>
开发者ID:noose,项目名称:Planeta,代码行数:31,代码来源:listSuccess.php

示例10: array

// link_to_if()
$t->diag('link_to_if()');
$t->is(link_to_if(true, 'test', '@homepage'), '<a href="module/action">test</a>', 'link_to_if() returns an HTML "a" tag if the condition is true');
$t->is(link_to_if(false, 'test', '@homepage'), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false');
$t->is(link_to_if(false, 'test', '@homepage', array('tag' => 'div')), '<div>test</div>', 'link_to_if() takes a "tag" option');
$t->is(link_to_if(true, 'test', '@homepage', 'tag=div'), '<a href="module/action">test</a>', 'link_to_if() removes "tag" option (given as string) in true case');
$t->is(link_to_if(true, 'test', '@homepage', array('tag' => 'div')), '<a href="module/action">test</a>', 'link_to_if() removes "tag" option (given as array) in true case');
$t->is(link_to_if(false, 'test', '@homepage', array('query_string' => 'foo=bar', 'absolute' => true, 'absolute_url' => 'http://www.google.com/')), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false');
$t->is(link_to_if(true, 'test', 'homepage', array(), array('class' => 'test')), '<a class="test" href="homepage">test</a>', 'link_to_if() accepts link_to2 compatible usage');
$t->is(link_to_if(false, 'test', 'homepage', array(), array('class' => 'test')), '<span class="test">test</span>', 'link_to_if() accepts link_to2 compatible usage');
// link_to_unless()
$t->diag('link_to_unless()');
$t->is(link_to_unless(false, 'test', '@homepage'), '<a href="module/action">test</a>', 'link_to_unless() returns an HTML "a" tag if the condition is false');
$t->is(link_to_unless(true, 'test', '@homepage'), '<span>test</span>', 'link_to_unless() returns an HTML "span" tag by default if the condition is true');
$t->is(link_to_unless(true, 'test', 'homepage', array(), array('class' => 'test')), '<span class="test">test</span>', 'link_to_unless() accepts link_to2 compatible usage');
$t->is(link_to_unless(false, 'test', 'homepage', array(), array('class' => 'test')), '<a class="test" href="homepage">test</a>', 'link_to_unless() accepts link_to2 compatible usage');
// public_path()
$t->diag('public_path()');
$t->is(public_path('pdf/download.pdf'), '/public/pdf/download.pdf', 'public_path() returns the public path');
$t->is(public_path('/pdf/download.pdf'), '/public/pdf/download.pdf', 'public_path() returns the public path if starting with slash');
$t->is(public_path('pdf/download.pdf', true), 'https://example.org/public/pdf/download.pdf', 'public_path() returns the public path');
// mail_to()
$t->diag('mail_to()');
$t->is(mail_to('fabien.potencier@symfony-project.com'), '<a href="mailto:fabien.potencier@symfony-project.com">fabien.potencier@symfony-project.com</a>', 'mail_to() creates a mailto a tag');
$t->is(mail_to('fabien.potencier@symfony-project.com', 'fabien'), '<a href="mailto:fabien.potencier@symfony-project.com">fabien</a>', 'mail_to() creates a mailto a tag');
preg_match('/href="(.+?)"/', mail_to('fabien.potencier@symfony-project.com', 'fabien', array('encode' => true)), $matches);
$t->is(html_entity_decode($matches[1], ENT_QUOTES, 'UTF-8'), 'mailto:fabien.potencier@symfony-project.com', 'mail_to() can encode the email address');
$t->diag('mail_to test');
$t->is(mail_to('webmaster@example.com'), '<a href="mailto:webmaster@example.com">webmaster@example.com</a>', 'mail_to with only given email works');
$t->is(mail_to('webmaster@example.com', 'send us an email'), '<a href="mailto:webmaster@example.com">send us an email</a>', 'mail_to with given email and title works');
$t->isnt(mail_to('webmaster@example.com', 'encoded', array('encode' => true)), '<a href="mailto:webmaster@example.com">encoded</a>', 'mail_to with encoding works');
开发者ID:Phennim,项目名称:symfony1,代码行数:31,代码来源:UrlHelperTest.php

示例11: testObjectWithToString

    {
        return 'test';
    }
}
$o2 = new testObjectWithToString();
$t->is(link_to($o2), '<a href="module/action">test</a>', 'link_to() can take an object as its first argument');
// link_to_if()
$t->diag('link_to_if()');
$t->is(link_to_if(true, 'test', ''), '<a href="module/action">test</a>', 'link_to_if() returns an HTML "a" tag if the condition is true');
$t->is(link_to_if(false, 'test', ''), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false');
$t->is(link_to_if(false, 'test', '', array('tag' => 'div')), '<div>test</div>', 'link_to_if() takes a "tag" option');
$t->is(link_to_if(true, 'test', '', 'tag=div'), '<a href="module/action">test</a>', 'link_to_if() removes "tag" option (given as string) in true case');
$t->is(link_to_if(true, 'test', '', array('tag' => 'div')), '<a href="module/action">test</a>', 'link_to_if() removes "tag" option (given as array) in true case');
$t->is(link_to_if(false, 'test', '', array('query_string' => 'foo=bar', 'absolute' => true, 'absolute_url' => 'http://www.google.com/')), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false');
// link_to_unless()
$t->diag('link_to_unless()');
$t->is(link_to_unless(false, 'test', ''), '<a href="module/action">test</a>', 'link_to_unless() returns an HTML "a" tag if the condition is false');
$t->is(link_to_unless(true, 'test', ''), '<span>test</span>', 'link_to_unless() returns an HTML "span" tag by default if the condition is true');
// mail_to()
$t->diag('mail_to()');
$t->is(mail_to('fabien.potencier@symfony-project.com'), '<a href="mailto:fabien.potencier@symfony-project.com">fabien.potencier@symfony-project.com</a>', 'mail_to() creates a mailto a tag');
$t->is(mail_to('fabien.potencier@symfony-project.com', 'fabien'), '<a href="mailto:fabien.potencier@symfony-project.com">fabien</a>', 'mail_to() creates a mailto a tag');
preg_match('/href="(.+?)"/', mail_to('fabien.potencier@symfony-project.com', 'fabien', array('encode' => true)), $matches);
$t->is(html_entity_decode($matches[1], ENT_QUOTES, 'UTF-8'), 'mailto:fabien.potencier@symfony-project.com', 'mail_to() can encode the email address');
$t->diag('mail_to test');
$t->is(mail_to('webmaster@example.com'), '<a href="mailto:webmaster@example.com">webmaster@example.com</a>', 'mail_to with only given email works');
$t->is(mail_to('webmaster@example.com', 'send us an email'), '<a href="mailto:webmaster@example.com">send us an email</a>', 'mail_to with given email and title works');
$t->isnt(mail_to('webmaster@example.com', 'encoded', array('encode' => true)), '<a href="mailto:webmaster@example.com">encoded</a>', 'mail_to with encoding works');
$t->is(mail_to('webmaster@example.com', '', array(), array('subject' => 'test subject', 'body' => 'test body')), '<a href="mailto:webmaster@example.com?subject=test+subject&amp;body=test+body">webmaster@example.com</a>', 'mail_to() works with given default values in array form');
$t->is(mail_to('webmaster@example.com', '', array(), 'subject=test subject body=test body'), '<a href="mailto:webmaster@example.com?subject=test+subject&amp;body=test+body">webmaster@example.com</a>', 'mail_to() works with given default values in string form');
$t->is(mail_to('webmaster@example.com', '', array(), 'subject=Hello World and more'), '<a href="mailto:webmaster@example.com?subject=Hello+World+and+more">webmaster@example.com</a>', 'mail_to() works with given default value with spaces');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:UrlHelperTest.php

示例12: link_to

    <?php 
        $filterParam .= '&schema_property_element_id=' . $sf_params->get('schema_property_element_id');
    }
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), 'schemahistory/list?page=1' . $filterParam);
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), 'schemahistory/list?page=' . $pager->getPreviousPage() . $filterParam);
    ?>

  <?php 
    foreach ($pager->getLinks() as $page) {
        ?>
    <?php 
        echo link_to_unless($page == $pager->getPage(), $page, 'schemahistory/list?page=' . $page . $filterParam);
        ?>
  <?php 
    }
    ?>

  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), 'schemahistory/list?page=' . $pager->getNextPage() . $filterParam);
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), 'schemahistory/list?page=' . $pager->getLastPage() . $filterParam);
}
?>
</div>
<?php 
echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults());
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:_list.php

示例13: link_to_if

/**
 * Create a link tag of the given +name+ using an URL created by the set of +options+, if +condition+
 * is true, in which case only the name is returned (or the given block is yielded, if one exists).
 */ 
function link_to_if( $condition, $name, $options = array(), $html_options = array() )
{
	return link_to_unless( !$condition, $name, $options, $html_options, func_get_args() );
}
开发者ID:rgantt,项目名称:sake,代码行数:8,代码来源:url_helper.php

示例14: link_to

<div class="float-right">
<?php 
if ($pager->haveToPaginate()) {
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), 'oferta/list?page=1');
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), 'oferta/list?page=' . $pager->getPreviousPage());
    ?>

  <?php 
    foreach ($pager->getLinks() as $page) {
        ?>
    <?php 
        echo link_to_unless($page == $pager->getPage(), $page, 'oferta/list?page=' . $page);
        ?>
  <?php 
    }
    ?>

  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), 'oferta/list?page=' . $pager->getNextPage());
    ?>
  <?php 
    echo link_to(image_tag(sfConfig::get('sf_admin_web_dir') . '/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), 'oferta/list?page=' . $pager->getLastPage());
}
?>
</div>
<?php 
echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults());
开发者ID:laiello,项目名称:infoteknia,代码行数:31,代码来源:_list.php

示例15: foreach

// OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
// all the essential functionalities required for any enterprise.
// Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com

// OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
// the GNU General Public License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.

// OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along with this program;
// if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA  02110-1301, USA
*/
if (isset($params)) {
    foreach ($params as $parameterSet) {
        $parametrString .= $parameterSet;
    }
} else {
    $parametrString = '';
}
echo link_to_unless($pager->getPage() == 1, __('First') . " ", $url, array('query_string' => 'page=1' . $parametrString));
echo link_to_unless($pager->getPreviousPage() == $pager->getPage(), __('Previous'), $url, array('query_string' => 'page=' . $pager->getPreviousPage() . $parametrString));
foreach ($pager->getLinks() as $page) {
    echo link_to_unless($page == $pager->getPage(), $page, $url, array('query_string' => 'page=' . $page . $parametrString));
}
echo link_to_unless($pager->getNextPage() == $pager->getPage(), __('Next'), $url, array('query_string' => 'page=' . $pager->getNextPage() . $parametrString));
echo link_to_unless($pager->getLastPage() == $pager->getPage(), __('Last'), $url, array('query_string' => 'page=' . $pager->getLastPage() . $parametrString));
开发者ID:THM068,项目名称:orangehrm,代码行数:30,代码来源:_paging_links.php


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