個人用ツール

「ver4/関数リファレンス/getContentModifiedDate」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
(ページの作成:「[このコンテンツは内容調整中です] ## 説明 コンテンツ更新日を取得 ## 使い方 <syntaxhighlight lang="php"> $this->BcBaser->getContentModified...」)
 
 
(2人の利用者による、間の7版が非表示)
行1: 行1:
[このコンテンツは内容調整中です]
 
  
 
## 説明
 
## 説明
コンテンツ更新日を取得
+
コンテンツ更新日を取得する。<br>
 +
コンテンツ更新日は、
 +
'''編集画面 > オプション > 作成者 > [更新日]'''から、手動で更新します。
  
 
## 使い方
 
## 使い方
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
$this->BcBaser->getContentModifiedDate([$format]);
+
<?php $this->BcBaser->getContentModifiedDate([$format]); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
## パラメータ
 
## パラメータ
$format
+
(string) $format
 
: フォーマット
 
: フォーマット
 
+
初期値: 'Y/m/d H:i'
    - 初期値: 'Y/m/d H:i'
+
  
 
## 戻り値
 
## 戻り値
 
+
(null | string)
コンテンツ作成日
+
: null または コンテンツ更新日
 
+
  
 
## 用例
 
## 用例
 
### 基本
 
### 基本
 +
コンテンツ更新日を取得し、echoで出力する。
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
+
<?php echo $this->BcBaser->getContentModifiedDate(); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
####出力
 
####出力
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
 
+
2018/10/27 23:30
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
### 応用
 
### 応用
 +
コンテンツ更新日を指定した書式で取得し、echoで出力する。
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
+
<?php echo $this->BcBaser->getContentModifiedDate('M. j. D'); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
####出力
 
####出力
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
 
+
Oct. 27. Sat
 
</syntaxhighlight>
 
</syntaxhighlight>
 
## 注
 
  
 
## 変更履歴
 
## 変更履歴
 
+
- [https://github.com/baserproject/basercms/blob/98c5d24daca66c38dfbd2b67c0ac85a3b5902b26/lib/Baser/View/Helper/BcBaserHelper.php#L2635 4.4.0]
## ソースファイル
+
 
+
## 関連資料
+
  
 
##類似の関数
 
##類似の関数
 
+
- [getContentCreatedDate](/ver4/関数リファレンス/getContentCreatedDate) - コンテンツ作成日を取得
 
+
- [getUpdateInfo](/ver4/関数リファレンス/getUpdateInfo) - 更新情報を取得する
[[Category:関数リファレンスver4]]
+
- [updateInfo](/ver4/関数リファレンス/updateInfo) - 更新情報を出力する

2020年10月20日 (火) 15:57時点における最新版

説明

コンテンツ更新日を取得する。
コンテンツ更新日は、 編集画面 > オプション > 作成者 > [更新日]から、手動で更新します。

使い方

<?php $this->BcBaser->getContentModifiedDate([$format]); ?>

パラメータ

(string) $format
フォーマット
初期値: 'Y/m/d H:i'

戻り値

(null | string)
null または コンテンツ更新日

用例

基本

コンテンツ更新日を取得し、echoで出力する。

コード

<?php echo $this->BcBaser->getContentModifiedDate(); ?>

出力

2018/10/27 23:30

応用

コンテンツ更新日を指定した書式で取得し、echoで出力する。

コード

<?php echo $this->BcBaser->getContentModifiedDate('M. j. D'); ?>

出力

Oct. 27. Sat

変更履歴

類似の関数