Blog and Pages are now database driven, woo!
This commit is contained in:
parent
34fe54c20c
commit
1f1cf3b71b
20 changed files with 137 additions and 24 deletions
21
app/Models/PagesModel.php
Normal file
21
app/Models/PagesModel.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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();
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue