Login   Register  
PHP Classes
elePHPant
Icontem

File: controller.xml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of None  >  PHP Controller  >  controller.xml  >  Download  
File: controller.xml
Role: Auxiliary data
Content type: text/plain
Description: example controller xml file which controller.class loadds
Class: PHP Controller
Implements a controller of MVC applications
Author: By
Last change: upgraded to new schema and changed some examples
Date: 2006-02-06 10:44
Size: 2,399 bytes
 

Contents

Class file image Download
<?xml version="1.0" encoding="UTF-8"?>
<controller xmlns="http://users.visudo.com/eddie/PHP-Controller" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://users.visudo.com/eddie/PHP-Controller controller.xsd">
  <!-- schema version number -->
	<version>0.5</version>
  <!-- must end in slash -->
	<domain>http://localhost/PHP-Controller/</domain>
  <!-- must end in slash -->
  <pages>/Users/eddie/Documents/Eclipse/PHP-Controller/Pages/</pages> 

  <!-- this is the form user will be presented to login -->
	<authentication>
    <!-- a class must exist with this name, and it will handle auth -->
		<name>authentication</name> 
		<class>Authentication</class>
		<template>Authentication</template>
		<login-forward method-name="login">administrator</login-forward>
		<logout-forward method-name="logout">administrator</logout-forward>    
	</authentication>

	<!-- we can have infinate of these -->
	<page> 
    <!-- this will be the name accessed in url -->
		<name>forum</name> 
    <!-- and this the class that will be loaded -->
		<class>Forum</class> 
    <!-- if a template is used, this is the template name -->
		<template>Forum</template> 
    <!-- this only appears in one "page" -->
		<default-page>1</default-page> 
    <!-- if no method is defined in URL, this is called -->
		<default-method>messages</default-method>  
    <!-- after form submission the application will be forward to this page-->
    <form-forward method-name="addMessageAction">forum/messages</form-forward>
  </page>
	
	<page>
		<name>administrator</name>
		<class>Administrator</class>
		<template>Administrator</template>
		<default-method>users</default-method>
    <!-- after form submission the application will be forward to this page--> 
    <form-forward method-name="doAddUser">administrator</form-forward>
    <!--roles retrieved from authentication database and defined in $_SESSION['role'] -->
		<role>admin</role> 
	</page>

  
  
  

	<alias>
		<name>add</name> 
    <!-- must follow the rule: Class/Method?arg=1 -->
		<page>forum/addMessage</page>
	</alias>

  
	<alias>
    <!-- the alias name in the url -->
		<name>add/new/user</name> 
    <!-- must follow the rule: Class/Method?arg=1 -->
		<page>administrator/addUser?firstname=eddie tejeda</page><!-- spaces allowed -->
	</alias>

</controller>