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


PHP AkInflector::ordinalize方法代码示例

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


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

示例1: install

 public function install($version = null, $options = array())
 {
     $this->createTable('dummy_posts', 'id, title, body, hip_factor int, comments_count, posted_on, expires_at');
     $this->createTable('dummy_comments', 'id,name,body,dummy_post_id,created_at');
     $DummyPost = new DummyPost();
     $Post = $DummyPost->create(array('title' => 'One', 'body' => 'First post'));
     foreach (range(1, 5) as $n) {
         $Post->dummy_comment->add(new DummyComment(array('body' => AkInflector::ordinalize($n) . ' post')));
     }
     $Post->save();
 }
开发者ID:bermi,项目名称:akelos,代码行数:11,代码来源:dummy_post_installer.php

示例2: test_setup

 public function test_setup()
 {
     $TestSetup = new AkUnitTest();
     $TestSetup->installAndIncludeModels(array('Post', 'Comment', 'Tag'));
     $Post =& $TestSetup->Post->create(array('title' => 'One', 'body' => 'First post'));
     foreach (range(1, 5) as $n) {
         $Post->comment->add(new Comment(array('body' => AkInflector::ordinalize($n) . ' post')));
     }
     $Post->save();
     $Post->reload();
     $Post->comment->load();
     $this->assertEqual($Post->comment->count(), 5);
     $this->post_id = $Post->id;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:14,代码来源:_model_instantiation.php

示例3: _getDocumentationForMethod

 function _getDocumentationForMethod($ApiMethod)
 {
     $doc = !empty($ApiMethod->documentation) ? $ApiMethod->documentation . "\n" : '';
     foreach (array('expects', 'returns') as $expects_or_returns) {
         if (!empty($ApiMethod->{$expects_or_returns})) {
             foreach ($ApiMethod->{$expects_or_returns} as $k => $type) {
                 $doc .= "\n" . ($expects_or_returns == 'expects' ? Ak::t(AkInflector::ordinalize($k + 1)) . ' parameter as' : 'Returns') . " {$type}:";
                 if (!empty($ApiMethod->{$expects_or_returns . '_documentation'}[$k])) {
                     $doc .= ' ' . $ApiMethod->{$expects_or_returns . '_documentation'}[$k];
                 }
             }
         }
     }
     return $doc;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:15,代码来源:AkXmlRpcServer.php

示例4: ordinalize

 public function ordinalize()
 {
     return AkInflector::ordinalize($this->value);
 }
开发者ID:bermi,项目名称:akelos,代码行数:4,代码来源:number.php

示例5: Test_of_ordinalize

 function Test_of_ordinalize()
 {
     foreach ($this->OrdinalNumbers as $number => $ordinalized) {
         $this->assertEqual($ordinalized, AkInflector::ordinalize($number));
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:6,代码来源:AkInflector.php


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