本文整理汇总了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();
}
示例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;
}
示例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;
}
示例4: ordinalize
public function ordinalize()
{
return AkInflector::ordinalize($this->value);
}
示例5: Test_of_ordinalize
function Test_of_ordinalize()
{
foreach ($this->OrdinalNumbers as $number => $ordinalized) {
$this->assertEqual($ordinalized, AkInflector::ordinalize($number));
}
}