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


PHP Time::toPretty方法代码示例

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


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

示例1: actionIndex

 public function actionIndex($isForced = false, $isDebug = false)
 {
     $console = Console::getInstance($isForced, $isDebug);
     $console->debugStart('Entered');
     //        if (mail('evgeniy.siderka@hyuna.bb', 'test', 'test message')) {
     //            $console->writeLine('OK');
     //        } else {
     //            $console->writeLine('Failure');
     //        }
     $newExecutors = Site::getNewExecutors('2015-11-19 12:20:00');
     $report = '';
     foreach ($newExecutors as $e) {
         $sites = Site::model()->findAllByAttributes(array('executor_id' => $e));
         if (count($sites) < 1) {
             continue;
         }
         $report .= String::build('Positions for "{keyword}" ({date_from} - {date_to})', array('keyword' => $sites[0]->keyword->name, 'date_from' => Time::toPretty($sites[0]->updated_at), 'date_to' => Time::toPretty($sites[count($sites) - 1]->updated_at))) . PHP_EOL;
         foreach ($sites as $s) {
             $report .= String::build('{position}: {site}', array('position' => $s->position, 'site' => String::rebuildUrl($s->link, false, false, true, false))) . PHP_EOL;
         }
     }
     $console->writeLine($report);
     $console->debugEnd();
     return;
 }
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:25,代码来源:TestCommand.php

示例2: array

    
    <div class="row">
        <?php 
echo Chtml::submitButton('Add');
?>
    </div>
    
    <?php 
echo CHtml::endForm();
?>
</div>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvKeywords', 'dataProvider' => $keyword->search(), 'filter' => $keyword, 'htmlOptions' => array(), 'columns' => array(array('name' => 'name', 'header' => 'Keyword', 'type' => 'raw', 'value' => function ($e) {
    return String::build('<a href="{link}" title="Added on {created_at}">{keyword}</a>', array('link' => Yii::app()->createUrl('site/keywordDetails', array('keywordId' => $e->id)), 'created_at' => Time::toPretty($e->created_at), 'keyword' => $e->name));
}), array('name' => 'search_engine', 'header' => 'Search Engine', 'value' => function ($e) {
    return ucwords($e->search_engine);
}), array('name' => 'status', 'header' => 'Status', 'type' => 'raw', 'value' => function ($e) {
    return CHtml::tag('span', array('title' => String::build('Last Check: {last_check} Next Check: {next_check}', array('last_check' => Time::toPretty($e->checked_at), 'next_check' => $e->period ? date(Time::FORMAT_PRETTY, strtotime($e->checked_at) + $e->period) : 'No autocheck'))), ucwords($e->status));
}))));
?>
</div>

<script type="text/javascript">

$("#ddlPeriod").change(function () {
    $("#txfPeriod").val($(this).val());
});

</script>
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:30,代码来源:keywords.php

示例3: array

echo CHtml::label('Domains (each in new line)', 'txaDomain');
?>
        
        <?php 
echo CHtml::activeTextArea($ignoreList, 'domain', array('id' => 'txaDomain', 'cols' => 40, 'rows' => 5));
?>
    </div>
    
    <div class="row">
        <?php 
echo Chtml::submitButton('Add');
?>
    </div>
    
    <?php 
echo CHtml::endForm();
?>
</div>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvKeywords', 'dataProvider' => $ignoreList->search(), 'filter' => $ignoreList, 'htmlOptions' => array(), 'columns' => array(array('name' => 'domain', 'header' => 'Domain', 'value' => function ($e) {
    return $e->domain;
}), array('name' => 'created_at', 'header' => 'Added On', 'value' => function ($e) {
    return Time::toPretty($e->created_at);
}), array('header' => '', 'type' => 'raw', 'value' => function ($e) {
    return CHtml::link('Delete', Yii::app()->createUrl('site/ignoreListDelete', array('ignoreListId' => $e->id)));
}))));
?>
</div>
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:30,代码来源:ignore_list.php

示例4: array

</p>
<p>Pending keywords: <?php 
echo Keyword::model()->count('status = \'' . Keyword::STATUS_PENDING . '\'');
?>
</p>

<h3>Active Executors</h3>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvKeywords', 'dataProvider' => $executor->searchActive(), 'htmlOptions' => array(), 'columns' => array(array('name' => 'id', 'header' => 'ID', 'value' => function ($e) {
    return $e->id;
}), array('name' => 'keyword_id', 'header' => 'Keyword', 'value' => function ($e) {
    return String::build('{keyword_id}: {keyword}', array('keyword' => $e->keyword->name, 'keyword_id' => $e->keyword_id));
}), array('header' => 'Search Engine', 'value' => function ($e) {
    return ucwords($e->keyword->search_engine);
}), array('name' => 'status', 'header' => 'Status', 'value' => function ($e) {
    return ucwords($e->status);
}), array('name' => 'message', 'header' => 'Message', 'value' => function ($e) {
    return $e->message;
}), array('name' => 'created_at', 'header' => 'Created', 'value' => function ($e) {
    return Time::toPretty($e->created_at);
}), array('name' => 'updated_at', 'header' => 'Updated', 'value' => function ($e) {
    return Time::toPretty($e->updated_at);
}), array('header' => '', 'type' => 'raw', 'value' => function ($e) {
    if ($e->status == Executor::STATUS_ERROR) {
        return CHtml::link('Terminate', Yii::app()->createUrl('site/terminateExecutor', array('executorId' => $e->id)));
    }
}))));
?>
</div>
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:31,代码来源:statistics.php

示例5: array

    <?php 
echo CHtml::endForm();
?>
</div>

<p><a href="<?php 
echo Yii::app()->createUrl('site/reportsBrowse');
?>
">Browse Reports</a></p>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvKeywords', 'dataProvider' => $report->search(), 'filter' => $report, 'htmlOptions' => array(), 'columns' => array(array('name' => 'email', 'header' => 'Email', 'type' => 'raw', 'value' => function ($e) {
    return String::build('<span title="Added on {created_at}">{email}</span>', array('email' => $e->email, 'created_at' => Time::toPretty($e->created_at)));
}), array('name' => 'last_send_at', 'header' => 'Last Update', 'filter' => false, 'value' => function ($e) {
    return Time::toPretty($e->last_send_at);
}), array('header' => 'Next Update', 'value' => function ($e) {
    return date(Time::FORMAT_PRETTY, strtotime($e->last_send_at) + $e->period);
}), array('header' => '', 'type' => 'raw', 'value' => function ($e) {
    $links = '';
    if (time() - strtotime($e->last_send_at) > 600) {
        $links .= CHtml::link('Send Now', Yii::app()->createUrl('site/reportsSend', array('reportId' => $e->id))) . '&nbsp;';
    }
    $links .= Chtml::link('Delete', Yii::app()->createUrl('site/reportsDelete', array('reportId' => $e->id)));
    return $links;
}))));
?>
</div>

<script type="text/javascript">
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:30,代码来源:reports.php

示例6: array

<?php

/* @var $this SiteController */
$this->pageTitle = Yii::app()->name;
?>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvLeads', 'dataProvider' => $site->searchLeads(), 'columns' => array(array('name' => 'domain', 'header' => 'Domain', 'value' => function ($e) {
    return $e->domain;
}), array('name' => 'keyword', 'header' => 'Keyword', 'value' => function ($e) {
    return $e->keyword->name;
}), array('name' => 'created_at', 'header' => 'Added On', 'type' => 'raw', 'value' => function ($e) {
    return CHtml::tag('span', array('title' => String::build('by {search_engine} on {position} position', array('search_engine' => $e->keyword->search_engine, 'position' => $e->position))), Time::toPretty($e->created_at));
}))));
?>
</div>
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:17,代码来源:index.php

示例7: generate

 public function generate()
 {
     $reportHtml = '';
     $criteria = new CDbCriteria();
     $criteria->alias = 'site';
     $criteria->addCondition('site.deleted_at IS NULL');
     $criteria->group = 'site.domain';
     $criteria->distinct = true;
     $site = Site::model()->findAll($criteria);
     $reportHtml .= '<table>';
     $row = '<tr>';
     $row .= '<th>Domain</th>';
     $row .= '<th>Keyword</th>';
     $row .= '<th>Added On</th>';
     $row .= '</tr>';
     $reportHtml .= $row;
     foreach ($site as $s) {
         if (IgnoreList::isInList($s->domain)) {
             continue;
         }
         $row = '<tr>';
         $row .= '<td>' . $s->domain . '</td>';
         $row .= '<td>' . $s->keyword->name . '</td>';
         $row .= '<td>' . Time::toPretty($s->created_at) . '</td>';
         $row .= '</tr>';
         $reportHtml .= $row;
     }
     $reportHtml .= '</table><p><i>Report generated on ' . date(Time::FORMAT_PRETTY) . '</i></p>';
     return $reportHtml;
 }
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:30,代码来源:Report.php


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