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


PHP format_number_choice函数代码示例

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


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


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