本文整理汇总了PHP中Formatter::formatOrdinal方法的典型用法代码示例。如果您正苦于以下问题:PHP Formatter::formatOrdinal方法的具体用法?PHP Formatter::formatOrdinal怎么用?PHP Formatter::formatOrdinal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formatter
的用法示例。
在下文中一共展示了Formatter::formatOrdinal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/**@var Slide $model */
$this->breadcrumbs = array('Slides' => array('index'), Formatter::formatOrdinal($model->position + 1));
$this->menu = array(array('label' => 'List Slides', 'url' => array('index')), array('label' => 'Create Slide', 'url' => array('create')), array('label' => 'Update Slide', 'url' => array('update', 'id' => $model->slide_id)), array('label' => 'Delete Slide', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->slide_id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Slides', 'url' => array('admin')));
?>
<h1><?php
echo Formatter::formatOrdinal($model->position + 1) . " Slide";
?>
</h1>
<div class="row-fluid" id="area_slide">
<?php
$this->widget('bootstrap.widgets.TbCarousel', array('items' => array(array('image' => Slide::generateImagePath($model->slide_image, $model->getPrimaryKey()), 'label' => $model->label, 'caption' => $model->caption)), 'htmlOptions' => array('id' => 'viewSlider'), 'options' => array('interval' => false)));
?>
</div>
示例2: array
<?php
$this->breadcrumbs = array('Slides' => array('index'), 'Create');
$this->menu = array(array('label' => 'List Slides', 'url' => array('index')), array('label' => 'Manage Slides', 'url' => array('admin')));
?>
<h1>Create <?php
echo Formatter::formatOrdinal(Slide::model()->count() + 1);
?>
Slide</h1>
<?php
echo $this->renderPartial('_form', array('model' => $model));
示例3: actionUpdate
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id)
{
/* @param Slide $model*/
$model = $this->loadModel($id);
$maxPositions = Slide::model()->count();
Yii::log("PrevImage: " . $model->slide_image, 'log');
if (isset($_POST['Slide'])) {
$model->oldPosition = $model->position;
$model->attributes = $_POST['Slide'];
Yii::log("CurrImage: " . $model->slide_image, 'log');
$fileUpload = CUploadedFile::getInstance($model, 'slide_image');
Yii::log("FileUpload: " . CVarDumper::dumpAsString($fileUpload), 'log');
if ($fileUpload !== null) {
$model->removeImage();
$model->slide_image = $fileUpload;
}
if ($model->validate() && $model->save()) {
if ($fileUpload !== null) {
$model->slide_image->saveAs(Yii::app()->basePath . '/../files/images/slides/' . $model->slide_image . "_" . $model->getPrimaryKey());
}
$this->redirect(array('view', 'id' => $model->slide_id));
}
}
$viewablePositions = array();
foreach (range(0, $maxPositions - 1) as $position) {
$viewablePositions[$position] = Formatter::formatOrdinal($position + 1);
}
$this->positions = $viewablePositions;
$this->render('update', array('model' => $model));
}
示例4: array
<div class="view">
<hr/>
<div class="row-fluid" id="area_slide">
<h1 class="ordinal"><?php
echo Formatter::formatOrdinal($index + 1);
?>
</h1>
<?php
$this->widget('bootstrap.widgets.TbLinkCarousel', array('items' => array(array('image' => Slide::generateImagePath($data->slide_image, $data->slide_id), 'label' => $data->label, 'caption' => $data->caption, 'link' => array('view', 'id' => $data->slide_id))), 'htmlOptions' => array('id' => 'viewSlider'), 'options' => array('interval' => false)));
?>
</div>
</div>