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


PHP Y::dateTimeFromTime方法代码示例

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


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

示例1: foreach

            }
        }
    }
    if ($request->answers) {
        foreach ($request->answers as $answer) {
            $arr[] = array('name' => Yii::t('holes_view', 'HOLE_ANSWER_DATE_FROM', array('{0}' => $request->{$param}->name)), 'date' => Y::dateFromTime($answer->date));
            $arr[] = array('name' => Yii::t('holes_view', 'HOLE_ANSWER_CREATEDATE_FROM', array('{0}' => $request->{$param}->name)), 'date' => Y::dateTimeFromTime($answer->createdate));
        }
    }
}
$fixeds = $hole->fixeds;
if ($fixeds) {
    foreach ($fixeds as $fix) {
        $arr[] = array('name' => CHtml::tag('b', array(), Yii::t('holes_view', 'HOLE_FIX_USER', array('{0}' => $fix->user->FullName))));
        $arr[] = array('name' => Yii::t('holes_view', 'HOLE_FIX_DATE'), 'date' => Y::dateFromTime($fix->date_fix));
        $arr[] = array('name' => Yii::t('holes_view', 'HOLE_FIX_CREATEDATE'), 'date' => Y::dateTimeFromTime($fix->createdate));
    }
}
$dataProvider = new CArrayDataProvider($arr, array('pagination' => false, 'keyField' => false));
$this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $dataProvider, 'summaryText' => '', 'hideHeader' => true, 'template' => '{items}{pager}', 'columns' => array(array('name' => 'name', 'type' => 'raw'), 'date')));
?>
						</span>
					</p>
					<?php 
if (!$hole->PREMODERATED) {
    ?>
					<p><font class="errortext premoderate"><?php 
    echo Yii::t('holes_view', 'PREMODRATION_WARNING');
    ?>
</font><br/></p>
					<?php 
开发者ID:snipesn,项目名称:UkrYama-2,代码行数:31,代码来源:view.php

示例2: foreach

        foreach ($request->answers as $answer) {
            echo CHtml::openTag('div', array('class' => 'after'));
            echo '<h2>';
            echo Yii::t('holes_view', 'HOLE_AUTHREPLY_USER_DATE', array('{0}' => $request->{$param}->name, '{1}' => $request->user->fullname, '{2}' => date('d.m.Y', $answer->date)));
            echo '</h2>';
            if ($answer->files_other) {
                foreach ($answer->files_other as $file) {
                    echo "<p class='holes_pict_p'>";
                    if ($request->user_id == Yii::app()->user->id) {
                        echo CHtml::link(Yii::t('template', 'DELETE_FILE'), array('delanswerfile', 'id' => $file->id), array('class' => 'declarationBtn'));
                    }
                    echo "<br>" . CHtml::link($file->file_name, $answer->filesFolder . '/' . $file->file_name, array('class' => 'declarationBtn'));
                    echo "</p>";
                }
            }
            foreach ($answer->files_img as $img) {
                echo "<p class='holes_pict_p'>";
                if ($request->user_id == Yii::app()->user->id) {
                    echo CHtml::link(Yii::t('template', 'DELETE_IMAGE'), array('delanswerfile', 'id' => $img->id), array('class' => 'declarationBtn')) . '<br />';
                }
                echo CHtml::link(CHtml::image($answer->filesFolder . '/thumbs/' . $img->file_name), $answer->filesFolder . '/' . $img->file_name, array('class' => 'holes_pict', 'rel' => 'answer_' . $answer->id, 'title' => Yii::t('template', 'UPLOAD_AT_DATE', array('{0}' => Y::dateTimeFromTime($answer->createdate)))));
                echo "</p>";
            }
            //следует добавить ссылку для редактирования ответов
            echo CHtml::closeTag('div');
            if ($answer->comment) {
                echo Yii::t('template', 'COMMENT') . $answer->comment . "</p>";
            }
        }
    }
}
开发者ID:snipesn,项目名称:UkrYama-2,代码行数:31,代码来源:_viewanswers.php


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