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


PHP Formatter::formatOrdinal方法代码示例

本文整理汇总了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>




开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:17,代码来源:view.php

示例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));
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:13,代码来源:create.php

示例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));
 }
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:35,代码来源:SlideController.php

示例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>
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:21,代码来源:_view.php


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