public function index() { $status = 'Approve'; $data['result'] = Model\Portal\Comment::latest('date')->get(); $data['status'] = $status; $this->template->build('index', $data); }
/** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ public function index() { $visitor = new Library\Visitor\Visitor(); $data = ['visitor' => $visitor, 'visitor_today' => $visitor->countVisitorToday(), 'visitor_week' => $visitor->countVisitorByWeek(), 'visitor_month' => $visitor->countVisitorByMonth(), 'new_visitor_unique' => $visitor->getVisitorToday()->count(), 'popular_post' => Model\Portal\Article::popular()->get(), 'latest_comment' => Model\Portal\Comment::latest('date')->get()]; $this->template->inject_partial('script', '<script src="' . base_url('assets/admin/js/analytic.js') . '"></script>'); $this->template->build('dashboard', $data); }
public function index() { $status = $this->input->get('status') ?: 'publish'; if ($status == 'draft') { $this->indexDraft(); } else { $data['result'] = Model\Portal\Comment::latest('date')->get(); $data['status'] = $status; $this->template->build('index', $data); } }
<?php } ?> </div> </div> </div> </div> <div class="widget"> <div class="widget-heading"> <h3>Komentar Terkini</h3> </div> <div class="widget-content"> <div class="row"> <?php $comments = Model\Portal\Comment::latest('date')->get(); ?> <?php if ($comments->count()) { ?> <?php foreach ($comments as $comment) { ?> <div class="box-komentar-widget"> <div class="col-sm-3 col-xs-4"> <div class="box-komentar-widget-img"> <img src="<?php echo $comment->avatar; ?> " alt=""> </div>
<?php } ?> </div> </div> </div> </div> <div class="widget"> <div class="widget-heading"> <h3>LATEST KOMENTAR</h3> </div> <div class="widget-content"> <div class="row"> <?php foreach (Model\Portal\Comment::latest('date')->get() as $comment) { ?> <div class="box-komentar-widget"> <div class="col-sm-3 col-xs-4"> <div class="box-komentar-widget-img"> <img src="<?php echo $comment->avatar; ?> " alt=""> </div> </div> <div class="col-sm-9 col-xs-8"> <div class="box-komentar-widget-title"> <p><strong><a href="#"><?php echo $comment->nama; ?>