123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php namespace App\Controllers;
- use CodeIgniter\Controller;
- use CodeIgniter\I18n\Time;
- class Pages extends BaseController
- {
- protected $logic1;
- protected $logic2;
- protected $myTime;
- public function __construct()
- {
- parent::__construct();
- $this->myTime = parent::getTime();
- $this->myDate= date("d/m/Y",$this->myTime);
-
- }
- public function index()
- {
-
- echo $this->request->getVar('title');
- //return view('welcome_message');
- }
- public function showme($page = 'home')
- {
- $this->cachePage(DAY);
-
-
- $this->logic1= file_exists(APPPATH.'/Views/'.$page.'.php');
-
- if(( $this->logic1 == NUll)OR ($this->logic1 == False))
-
- {
-
- return redirect('noPage');
-
-
- }
- elseif(($this->logic1==1)OR($this->logic1==true))
- {
-
- $data = [
- 'title' =>ucfirst($page) ,
- 'date'=>$this->myDate
- ];
-
-
-
-
- echo view($page,$data);
-
-
-
- }
-
-
-
-
-
- }
-
-
-
-
-
- public function nopage()
- {
- $this->cachePage(DAY);
-
- $data = [
- 'title' => 'no page',
- //'result2'=>$result
- //above works
-
- 'date'=>$this->myDate
-
-
-
-
- ];
-
- echo view('noPage',$data);
-
-
-
-
-
-
- }
-
- }
-
-
-
-
|