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/PagesModel.php
2020-08-01 23:52:45 -04:00

21 lines
No EOL
373 B
PHP

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