https://www.packtpub.com/web-development/cms-design-using-php-and-jquery
On chapter one the give simple CMS example.
I am not able to understand the line:
$r=Page::getInstanceByName($page);
From where the method "getInstanceByName" is called?
I could not find such a method in the official Php documentation:
http://php.net/manual-lookup.php?pattern=getInstanceByName&scope=quickre f
Expand|Select|Wrap|Line Numbers
- <?php
- // index.php
- // { common variables and functions
- include_once('ww.incs/common.php');
- $page=isset($_REQUEST['page'])?$_REQUEST['page']:'';
- $id=isset($_REQUEST['id'])?(int)$_REQUEST['id']:0;
- // }
- // { get current page id
- if(!$id){
- if($page){ // load by name
- $r=Page::getInstanceByName($page);
- if($r && isset($r->id))$id=$r->id;
- }
- if(!$id){ // else load by special
- $special=1;
- if(!$page){
- $r=Page::getInstanceBySpecial($special);
- if($r && isset($r->id))$id=$r->id;
- }
- }
- }
The example code also throws error on windows Apache, but i am not dealing with them now. Please find CMS files enclosed.