public
|
|
public
string
|
#
getPagePath( )
return the page path of the controller
return the page path of the controller
Returns
string
|
public
|
#
set404( string $page )
for page not found
Parameters
|
public
|
#
set405( string $page )
method not found
Parameters
|
public
|
#
set501( string $page )
class not found
Parameters
|
private
|
|
public
|
#
addPermaLink( string $url_needle, string $mvc_page, string $mvc_method, array $mapping )
add a permalink / url mapping to the viewer (used for SEO optimization, require mod_rewrite)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
$this->addPermaLink('/p/', '', 'show', array('mvc_page')); // map a url "http://mydom.com/p/xyz" as sample to "http://mydom.com?mvc_page=xyz.php&mvc_method=show
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
add a permalink / url mapping to the viewer (used for SEO optimization, require mod_rewrite)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
$this->addPermaLink('/p/', '', 'show', array('mvc_page')); // map a url "http://mydom.com/p/xyz" as sample to "http://mydom.com?mvc_page=xyz.php&mvc_method=show
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
Parameters
- $url_needle
- $mvc_page
- // default page called for permalink, will be overwritten by requested parameter (GET/POST) and by mapping if exists
- $mvc_method
- // default method called for permalink, will be overwritten by requested parameter (GET/POST) and by mapping if exists
- $mapping
|
public
|
#
addURLMapping( string $url_needle, string $mvc_page, string $mvc_method, array $mapping )
add a permalink / url mapping to the viewer (used for SEO optimization, require RewriteEngine)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
add a permalink / url mapping to the viewer (used for SEO optimization, require RewriteEngine)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
Parameters
- $url_needle
- $mvc_page
- $mvc_method
- $mapping
|
public
|
#
addURLRouting( string $url_needle, string $mvc_page, string $mvc_method, array $mapping )
add a permalink / url routing to the viewer (used for SEO optimization, require RewriteEngine)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
add a permalink / url routing to the viewer (used for SEO optimization, require RewriteEngine)
Required Rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #php file which implements the viewer RewriteRule · /index.php [L]
Sample: // should called in your derived viewer before the parent constructor is called $this->addPermaLink('/article/', 'article.php', 'show', array('num', 'color')); // map a url "http://mydom.com/article/12345/green" as sample to "http://mydom.com?mvc_page=article.php&mvc_method=show&num=12345&color=green
Notice: If you use the permalinks in your contant as links consider about to use rel=bookmark in the link"
Parameters
- $url_needle
- $mvc_page
- $mvc_method
- $mapping
|
public
array
|
#
getPermaLinkArray( )
return all permalinks set by "addPermaLink"
return all permalinks set by "addPermaLink"
Returns
array
|
public
array
|
#
getURLMappingArray( )
return all url mappings set by "addURLMapping"
return all url mappings set by "addURLMapping"
Returns
array
|
public
array
|
#
getURLRoutingArray( )
return all url routings set by "addURLRouting"
return all url routings set by "addURLRouting"
Returns
array
|
public
boolean
|
#
isAllowedURI( )
check the requested URI is allowed by routing/mapping
sample: $this->addPermaLink('/p/', '', 'show', array('mvc_page')); $this->addPermaLink('/cms/', 'cms.php', 'show', array('cms_uri'));
$this->set404($GLOBALS['DOCROOT'].'/templates/404.htm');
if(!$this->isAllowedURI()){ header_http_error(HTTP_NOT_FOUND); print file_get_contents($GLOBALS['DOCROOT'].'/templates/404.htm'); exit; }
check the requested URI is allowed by routing/mapping
sample: $this->addPermaLink('/p/', '', 'show', array('mvc_page')); $this->addPermaLink('/cms/', 'cms.php', 'show', array('cms_uri'));
$this->set404($GLOBALS['DOCROOT'].'/templates/404.htm');
if(!$this->isAllowedURI()){ header_http_error(HTTP_NOT_FOUND); print file_get_contents($GLOBALS['DOCROOT'].'/templates/404.htm'); exit; }
Returns
boolean
|
final public
string|array
|
#
execute( )
execute the subcontroller and return the content to the viewer as string or component array
execute the subcontroller and return the content to the viewer as string or component array
Returns
string|array
|