• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP format_number_choice函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendNotification

 public static function sendNotification($fromMember, $toMember, $diaryId)
 {
     $url = '/diary/' . $diaryId;
     sfApplicationConfiguration::getActive()->loadHelpers(array('I18N'));
     $message = format_number_choice('[1]1 diary has new comments|(1,Inf]%1% diaries have new comments', array('%1%' => '1'), 1);
     opNotificationCenter::notify($fromMember, $toMember, $message, array('category' => 'other', 'url' => $url, 'icon_url' => null));
 }
开发者ID:meruto,项目名称:opDiaryPlugin,代码行数:7,代码来源:opDiaryPluginUtil.class.php


示例2: pluralForm

 /**
  * Выбрать множественную форму склонения из словаря
  *
  * @param  string $text      - ключ словаря
  * @param  int    $number    - число
  * @param  string $catalogue - словарь
  * @param  array  $args      - аргументы оригинального хелпера __()
  * @return string
  */
 public static function pluralForm($text, $number, $args = array(), $catalogue = 'messages')
 {
     $index = abs((int) $number);
     if ($index > 100) {
         $index %= 100;
     }
     if ($index > 20) {
         $index %= 10;
     }
     switch ($index) {
         case 0:
             $index = 0;
             break;
         case 1:
             $index = 1;
             break;
         case 2:
         case 3:
         case 4:
             $index = 2;
             break;
         default:
             $index = 5;
     }
     $args = array_merge($args, array('%n%' => $number));
     return format_number_choice($text, $args, $index, $catalogue);
 }
开发者ID:pycmam,项目名称:sf-project-template,代码行数:36,代码来源:CommonHelper.php


示例3: sendNewCommentNotification

 public static function sendNewCommentNotification($fromMember, $toMember, $topicId)
 {
     $rootPath = sfContext::getInstance()->getRequest()->getRelativeUrlRoot();
     $url = $rootPath . '/communityTopic/' . $topicId;
     sfApplicationConfiguration::getActive()->loadHelpers(array('I18N'));
     $message = format_number_choice('[1]1 topic has new comments|(1,Inf]%1% topics have new comments', array('%1%' => '1'), 1);
     opNotificationCenter::notify($fromMember, $toMember, $message, array('category' => 'other', 'url' => $url, 'icon_url' => null));
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:8,代码来源:opCommunityTopicPluginUtil.class.php


示例4: executeSearch

 public function executeSearch(sfWebRequest $request)
 {
     $this->setCommonValues('gtu', 'code', $request);
     $this->form = new GtuFormFilter();
     $this->is_choose = $request->getParameter('is_choose', '') == '' ? 0 : intval($request->getParameter('is_choose'));
     if ($request->getParameter('gtu_filters', '') !== '') {
         $this->form->bind($request->getParameter('gtu_filters'));
         if ($this->form->isValid()) {
             $query = $this->form->getQuery();
             if ($request->getParameter('format') == 'json' || $request->getParameter('format') == 'text') {
                 $query->orderBy($this->orderBy . ' ' . $this->orderDir)->andWhere('latitude is not null');
                 $this->setLayout(false);
                 if ($request->getParameter('format') == 'json') {
                     $query->Limit($this->form->getValue('rec_per_page'));
                     $this->getResponse()->setContentType('application/json');
                     $this->items = $query->execute();
                     $this->setTemplate('geojson');
                     return;
                 } else {
                     $nbr_records = $query->count();
                     sfContext::getInstance()->getConfiguration()->loadHelpers('I18N');
                     $str = format_number_choice('[0]No Results Retrieved|[1]Your query retrieved 1 record|(1,+Inf]Your query retrieved %1% records out of %2%', array('%1%' => min($nbr_records, $this->form->getValue('rec_per_page')), '%2%' => $nbr_records), $nbr_records);
                     return $this->renderText($str);
                 }
             } else {
                 $query->orderBy($this->orderBy . ' ' . $this->orderDir);
                 $this->pagerLayout = new PagerLayoutWithArrows(new DarwinPager($query, $this->currentPage, $this->form->getValue('rec_per_page')), new Doctrine_Pager_Range_Sliding(array('chunk' => $this->pagerSlidingSize)), $this->getController()->genUrl($this->s_url . $this->o_url) . '/page/{%page_number}');
                 // Sets the Pager Layout templates
                 $this->setDefaultPaggingLayout($this->pagerLayout);
                 // If pager not yet executed, this means the query has to be executed for data loading
                 if (!$this->pagerLayout->getPager()->getExecuted()) {
                     $this->items = $this->pagerLayout->execute();
                 }
             }
             $gtu_ids = array();
             foreach ($this->items as $i) {
                 $gtu_ids[] = $i->getId();
             }
             $tag_groups = Doctrine::getTable('TagGroups')->fetchByGtuRefs($gtu_ids);
             foreach ($this->items as $i) {
                 $i->TagGroups = new Doctrine_Collection('TagGroups');
                 foreach ($tag_groups as $t) {
                     if ($t->getGtuRef() == $i->getId()) {
                         $i->TagGroups[] = $t;
                     }
                 }
             }
         }
     }
 }
开发者ID:naturalsciences,项目名称:Darwin,代码行数:50,代码来源:actions.class.php


示例5: include_partial

<tfoot>
    <tr>
        <th colspan="6">
            <?php 
if ($pager->haveToPaginate()) {
    ?>
                <?php 
    include_partial('report/pagination', array('pager' => $pager, 'url' => $url));
    ?>
            <?php 
}
?>

            <?php 
echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin');
?>
            <?php 
if ($pager->haveToPaginate()) {
    ?>
                <?php 
    echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin');
    ?>
            <?php 
}
?>
        </th>
    </tr>
</tfoot>
开发者ID:rbolliger,项目名称:otokou,代码行数:28,代码来源:_reports_list_tfoot.php


示例6: image_tag

 of <?php 
echo $profile->getCampus();
?>
</span>
  <span>Department: </span>
  <span><?php 
echo $profile->getDepartment();
?>
 / <?php 
echo $profile->getSubdepartment();
?>
</span>
  <div><?php 
echo image_tag($profile->getThumbnail());
?>
</div>
  <span>Cothink Rating: </span>
  <span><?php 
echo $profile->getRating();
?>
 (<?php 
echo $profile->getRatingCount();
?>
)</span>
  <span>Privacy: </span>
  <span><?php 
echo format_number_choice('[0]High[1]High|[2]Medium|[3]Low|(3,+Inf]Unknown', '', $profile->getPrivacyLevel());
?>
</span>
</div>
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:_editSummary.php


示例7: link_to

echo link_to($post->getTitle(), 'sfSimpleBlogPostAdmin/edit?id=' . $post->getId());
?>
  <?php 
if (!$post->getIsPublished()) {
    echo __('(not published)');
}
?>
</h2>

<i><?php 
echo __('Posted by %1% on %2%, tagged %3%', array('%1%' => $post->getAuthor(), '%2%' => format_date($post->getCreatedAt('U')), '%3%' => $post->getTagsAsString()));
?>
</i>
<div>
<?php 
echo $post->getExtract();
?>
</div>
(<?php 
echo format_number_choice('[0]no comment|[1]one comment|(1,+Inf]%1% comments', array('%1%' => $post->getNbComments()), $post->getNbComments());
?>
)
<?php 
if (!$post->allowComments()) {
    ?>
(<?php 
    echo __('Comments closed');
    ?>
)
<?php 
}
开发者ID:kriswallsmith,项目名称:sfSimpleBlogPlugin,代码行数:31,代码来源:_post.php


示例8: __

  
  <div class="details">
  <?php 
echo __('Posted by %1% on %2%', array('%1%' => $post->getAuthor(), '%2%' => format_date($post->getPublishedAt('U'))));
?>
  <?php 
if ($tags = $post->getSfSimpleBlogTags(null, null, ESC_RAW)) {
    ?>
    <?php 
    echo __('in %1%', array('%1%' => get_tag_links($tags)));
    ?>
  <?php 
}
?>
  <?php 
if ($in_list) {
    ?>
  - <?php 
    echo link_to_post($post, format_number_choice('[0]no comment|[1]one comment|(1,+Inf]%1% comments', array('%1%' => $post->getNbComments()), $post->getNbComments()), '#comments');
    ?>
  <?php 
}
?>
  </div>
  
  <div class="content">
    <?php 
echo $post->getContent(ESC_RAW);
?>
  </div>
</div>
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:30,代码来源:_post.php


示例9: format_number_choice

    if ($jotag_object) {
        ?>
						<input type="hidden" name="custom" value="RENEW" />
						<input type="hidden" name="item_name" value="<?php 
        echo format_number_choice("[1]Personalized JoTAG - Extra %count% year|[1,+Inf]Personalized JoTAG - Extra %count% years", array("%count%" => $payment->getDuration()), $form["duration"]->getValue());
        ?>
 (<?php 
        echo $payment->getTag()->getJotag();
        ?>
)" />
					<?php 
    } else {
        ?>
						<input type="hidden" name="custom" value="NEW" />
						<input type="hidden" name="item_name" value="<?php 
        echo format_number_choice("[1]Personalized JoTAG - %count% year|[1,+Inf]Personalized JoTAG - %count% years", array("%count%" => $payment->getDuration()), $form["duration"]->getValue());
        ?>
 (<?php 
        echo $payment->getJotag();
        ?>
)" />
					<?php 
    }
    ?>
					<input type="hidden" name="item_number" value="1" />
					<input type="hidden" name="amount" value="<?php 
    echo $payment->getAmount();
    ?>
" />
					<input type="hidden" name="rm" value="2" />
					<input type="hidden" name="return" value="<?php 
开发者ID:psskhal,项目名称:symfony-sample,代码行数:31,代码来源:Copy+of+buySuccess.php


示例10: __

<h1><?php 
echo __('Close periods for %room_name%', array('%room_name%' => $room->getName()));
?>
</h1>

<p>
<?php 
echo format_number_choice('[0]No close periods in the database.|[1]There is actually one close period in the database.|(1,+Inf]There is actually %count% close periods in the database.', array('%count%' => $count), $count);
?>
</p>

<p>
	<?php 
echo __('You may also %room_link%.', array('%room_link%' => link_to(__('go back to the room page'), 'room/index')));
?>
</p>

<?php 
if ($count > 0) {
    ?>

<table class="list">
  <thead>
    <tr>
			<th class="small"></th>
			<th><?php 
    echo sort_link('closeperiod', 'index', 'start', __('Start'), $sort_direction, $sort_column, array('roomId' => $room->getId()));
    ?>
</th>
			<th><?php 
    echo sort_link('closeperiod', 'index', 'stop', __('Stop'), $sort_direction, $sort_column, array('roomId' => $room->getId()));
开发者ID:jfesquet,项目名称:tempos,代码行数:31,代码来源:indexSuccess.php


示例11: format_date

	        <td><?php 
            echo $task->getSfGuardUser()->getProfile();
            ?>
</td>
	        <td><?php 
            echo format_date($task->getBegin()) . ' - ' . format_date($task->getFinish());
            ?>
</td>
	        <td><?php 
            foreach ($task->getUsers() as $user) {
                echo $user->getSfGuardUser()->getProfile() . '<br />';
            }
            ?>
</td>
	        <td><?php 
            echo format_number_choice('[0]Complete|[1]In Progress|[2]Pending/Planning|(2,+Inf]Unknown task status code)', '', $task->getStatus());
            ?>
</td>
	      <?php 
        } else {
            ?>
	    		<td colspan="4"><s><?php 
            echo link_to($task->getName(), 'tasks/show?slug=' . $task->getSlug());
            ?>
</td>
	    		<td>complete</td>
	    	<?php 
        }
        ?>
      </tr>
      <?php 
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:_project_tasklist.php


示例12: __

<h1><?php 
echo __('Zone list');
?>
</h1>

<noscript>
<?php 
include_partial('tools/messageBox', array('class' => 'warning', 'title' => __('Javascript disabled'), 'msg' => __('JavaScript is disabled. Deletion and move functions disabled due to security measures.'), 'showImg' => true));
?>
</noscript>

<p>
<?php 
echo format_number_choice('[0]No zones in the database.|[1]There is actually one zone in the database.|(1,+Inf]There is actually %count% zones in the database.', array('%count%' => $zone_total_count), $zone_total_count);
?>
</p>

<?php 
if (count($zone_list) > 0) {
    ?>
<table class="tree list">
	<thead>
		<tr>
			<th colspan="<?php 
    echo $recursion + 1;
    ?>
"><?php 
    echo __('Zones');
    ?>
</th>
			<th><?php 
开发者ID:jfesquet,项目名称:tempos,代码行数:31,代码来源:indexSuccess.php


示例13: slot

<?php

slot('title', 'Successfly updated');
?>
<div class="page" id="mass_action_status">
  <h1><?php 
echo __('Action Status :');
?>
</h1>
  <div>
    <?php 
echo format_number_choice('[0] No Item modified|[1] Everything seems to go well. Your action was applied to 1 record |(1,+Inf] Everything seems to go well. Your action was applied to %1% records', array('%1%' => $nb_items), $nb_items);
?>
  </div>
  <p>
    <?php 
echo link_to('Do another action', 'massactions/index');
?>
    <?php 
echo link_to('Go to the board', '@homepage');
?>
  </p>
</div>
开发者ID:naturalsciences,项目名称:Darwin,代码行数:23,代码来源:statusSuccess.php


示例14: foreach

<?php 
$i = 1;
foreach ($pager->getResults() as $nota) {
    $odd = fmod(++$i, 2);
    ?>
<tr class="sf_admin_row_<?php 
    echo $odd;
    ?>
">
<?php 
    include_partial('notas_td_tabular', array('nota' => $nota));
    //include_partial('notas_td_actions', array('nota' => $nota))
    ?>
</tr>
<?php 
}
?>
</tbody>
<tfoot>
<tr><th colspan="4">
<div class="float-right">
<?php 
$cuantos = $pager->getNbResults();
$texto = format_number_choice('[0] no hay notas|[1] hay 1 nota|(1,+Inf] hay %1% notas', array('%1%' => $cuantos), $cuantos);
echo link_to($texto, 'notas/list');
?>
</div>
</th></tr>
</tfoot>
</table>
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:30,代码来源:_notas_list.php


示例15: format_number_choice

</li>
    <?php 
}
?>
  </ul>
    
  <div class="forum_figures">
    <?php 
echo format_number_choice('[1]1 message, no reply|(1,+Inf]%posts% messages', array('%posts%' => $post_pager->getNbResults()), $post_pager->getNbResults(), 'sfSimpleForum');
?>
 
    <?php 
if (sfConfig::get('app_sfSimpleForumPlugin_count_views', true)) {
    ?>
    - <?php 
    echo format_number_choice('[0,1]1 view|(1,+Inf]%views% views', array('%views%' => $topic->getNbViews()), $topic->getNbViews(), 'sfSimpleForum');
    ?>
    <?php 
}
?>
    <?php 
if (sfConfig::get('app_sfSimpleForumPlugin_use_feeds', true)) {
    ?>
      <?php 
    echo link_to(image_tag('/sfSimpleForumPlugin/images/feed-icon.png', 'align=top'), 'sfSimpleForum/topicFeed?id=' . $topic->getId() . '&stripped_title=' . $topic->getStrippedTitle(), 'title=' . $feed_title);
    ?>
    <?php 
}
?>
    
  </div>
开发者ID:kriswallsmith,项目名称:sfSimpleForumPlugin,代码行数:31,代码来源:topicSuccess.php


示例16: use_helper

<?php use_helper('I18N') ?>
<?php if (method_exists($object instanceof sfOutputEscaper ? $object->getRawValue() : $object, 'allowComments')): ?>
  <?php $enable_comment = sfNestedCommentConfig::isCommentEnabled() && $object->allowComments() ?>
<?php else: ?>
  <?php $enable_comment = sfNestedCommentConfig::isCommentEnabled() ?>
<?php endif; ?>

<?php if(0 < $nb_comments = $object->getNbApprovedComments()): ?>
  <h3 id="comments-title"><?php echo format_number_choice('[1]One comment so far|(1,+Inf]%1% comments so far', array('%1%' => $nb_comments), $nb_comments) ?></h3>
<?php endif; ?>
<div id="sfNestedComment_comment_list">
  <?php include_partial('sfNestedComment/comment_list', array('comments' => $comments)) ?>
</div>
<?php if(!$enable_comment): ?>
  <div class="comment-closed"><?php echo __('Comments are closed.') ?></div>
<?php elseif($sf_user->getFlash('add_comment') == 'moderated'): ?>
  <div class="comment-moderated"><?php echo __('Your comment has been submitted and is awaiting moderation') ?></div>
<?php endif; ?>
<?php if($enable_comment): ?>
  <?php include_partial('sfNestedComment/add_comment', array('commentForm' => $commentForm)) ?>
<?php endif; ?>
开发者ID:nibsirahsieu,项目名称:sfNestedCommentPlugin,代码行数:21,代码来源:_comments.php


示例17: link_to

        <h2><?php 
echo link_to(Text::denominazioneAttoShort($atto), '@singolo_atto?id=' . $atto->getId());
?>
</h2>
      </li>
      <?php 
if ($nb_emendamenti > 0) {
    ?>
        <li class="<?php 
    echo $current == 'emendamenti' ? 'current' : '';
    ?>
">
          <h5><?php 
    echo link_to(format_number_choice('[1]Un emendamento|(1,+Inf]%1% emendamenti', array('%1%' => $nb_emendamenti), $nb_emendamenti), '@emendamenti_atto?id=' . $atto->getId());
    ?>
</h5>
        </li>    
      <?php 
}
?>
      <li class="<?php 
echo $current == 'commenti' ? 'current' : '';
?>
">
        <h5><?php 
echo link_to(format_number_choice('[0]Lascia un commento|[1]Un commento|(1,+Inf]%1% commenti', array('%1%' => $nb_comments), $nb_comments), '@commenti_atto?id=' . $atto->getId());
?>
</h5>
      </li>
    </ul>
</nav>
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:_atto_tabs.php


示例18: use_helper

<?php

use_helper('I18N');
use_helper('Javascript');
?>
<span id="sf_countable_<?php 
echo $token;
?>
">
  <?php 
echo format_number_choice('[0]Never viewed|[1]Viewed one time|(1,+Inf]Viewed %1% times', array('%1%' => $counter), $counter);
?>
</span>
<?php 
if (!$sf_request->getCookie($token) == $token) {
    ?>
  <?php 
    echo javascript_tag(remote_function(array('update' => 'sf_countable_' . $token, 'url' => '@sf_counter?sf_countable_token=' . $token)));
}
开发者ID:sgrove,项目名称:cothinker,代码行数:19,代码来源:_counter.php


示例19: include_partial

		<?php 
    include_partial('searchForm', array('form' => $form));
    ?>
	</div>

	<p>
		<?php 
    echo __('You can also %clear_filter_link%.', array('%clear_filter_link%' => link_to(__('clear the filter'), 'room/index?clear=')));
    ?>
	</p>
<?php 
} else {
    ?>
	<p>
		<?php 
    echo format_number_choice('[0]No rooms in the database.|[1]There is actually one room in the database.|(1,+Inf]There is actually %count% rooms in the database.', array('%count%' => $count), $count);
    ?>
	</p>

	<p>
		<?php 
    echo __('If you want a better view on room organization, you can go to %zone_link%.', array('%zone_link%' => link_to(__('the zone view'), 'zone/index')));
    ?>
	</p>

	<p>
		<?php 
    echo __('You can also %search_link%.', array('%search_link%' => link_to(__('search for a specific room'), 'room/search')));
    ?>
	</p>
<?php 
开发者ID:jfesquet,项目名称:tempos,代码行数:31,代码来源:indexSuccess.php


示例20: field_activities_data

             $date = $timedate;
         }
         echo !$mobile_version ? '</td><td>' : ' - ';
         echo field_activities_data($outing, array('raw' => true));
         echo !$mobile_version ? '</td><td>' : ' - ';
         $author_info =& $outing['versions'][0]['history_metadata']['user_private_data'];
         $georef = '';
         if (!$outing->getRaw('geom_wkt') instanceof Doctrine_Null) {
             $georef = ($mobile_version ? ' - ' : '') . picto_tag('action_gps', __('has GPS track'));
         }
         $images = '';
         if (isset($outing['nb_images'])) {
             if ($mobile_version) {
                 $images = ' - ' . picto_tag('picto_images_light') . '&nbsp;' . $outing['nb_images'];
             } else {
                 $images = picto_tag('picto_images_light', format_number_choice('[1]1 image|(1,+Inf]%1% images', array('%1%' => $outing['nb_images']), $outing['nb_images']));
             }
         }
         $outing_lang = $outing->get('culture');
         echo link_to($outing->get('name'), '@document_by_id_lang_slug?module=outings&id=' . $outing->get('id') . '&lang=' . $outing_lang . '&slug=' . get_slug($outing), array('hreflang' => $outing_lang)) . (!$mobile_version ? '</td><td>' : '') . $georef . (!$mobile_version ? '</td><td>' : '') . $images . (!$mobile_version ? '</td><td>' : ' - ') . link_to($author_info['topo_name'], '@document_by_id?module=users&id=' . $author_info['id']);
         echo !$mobile_version ? '</td></tr>' : '</li>';
     }
     echo !$mobile_version ? '</tbody></table>' : '</ul>';
     if (count($routes_outings) > 1) {
         echo simple_pager_navigation($count, count($routes_outings), 'routings_group_');
     }
     ?>
    </div>
 <?php 
 }
 // routes outings list link
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:viewSuccess.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP format_number_short函数代码示例发布时间:2022-05-15
下一篇:
PHP format_number函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap