本文整理汇总了PHP中Reply::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::all方法的具体用法?PHP Reply::all怎么用?PHP Reply::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$replies = Reply::all();
$markdown = new Markdown();
$transfer_count = 0;
$convert_count = 0;
foreach ($replies as $reply) {
if (empty($reply->body_original)) {
// store the original data
$reply->body_original = $reply->body;
// convert to markdown
$reply->body = $markdown->convertMarkdownToHtml($reply->body);
$reply->save();
$transfer_count++;
} else {
// convert to markdown
$reply->body = $markdown->convertMarkdownToHtml($reply->body_original);
$reply->save();
$convert_count++;
}
}
$this->info("Transfer old data count: " . $transfer_count);
$this->info("Convert original to body count: " . $convert_count);
$this->info("It's Done, have a good day.");
}
示例2: show
public function show()
{
//顯示留言
$users = User::orderBy('id', 'DESC')->paginate(10);
$reply = Reply::all();
$this->layout->content = View::make('users_main', array('users' => $users, 'replys' => $reply));
}