This repository has been archived on 2025-05-12. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hack13-blog/app/Models/BlogModel.php
2020-07-27 22:22:06 -04:00

21 lines
No EOL
371 B
PHP

<?php namespace App\Models;
use CodeIgniter\Model;
class BlogModel extends Model
{
protected $table = 'blog';
public function getBlog($slug = false)
{
if ($slug === false)
{
return $this->findAll();
}
return $this->asArray()
->where(['slug' => $slug])
->first();
}
}