Location: PHPKode > scripts > PHP Controller > php-controller/Controller.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Controller</title>
			<link rel="stylesheet" href="./media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="http://users.visudo.com/eddie/media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Controller</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHP-Controller implements the controller for building MVC applications.</p>
<p class="description"><p>The controller gives PHP applications a single entry point, from which the  user sends all requests to from the view to model, removing the need to have  to write code describing how the data will interact with the presentation.  This project is strongly influenced by the way current Java Pages are  handled and makes strong use of PHP classes for all pages. The controller  itself is an XML file which determines which classes are accessible by whom.</p></p>
		<p class="notes">
			Located in <a class="field" href="_Controller_class_php.html">/Controller.class.php</a> (line <span class="field">32</span>)
		</p>
		
				
		<pre>PEAR
   |
   --Controller</pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Constructor.png" alt=" "/>
											<span class="method-result">Controller</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">'controller.xml'</span>])
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getClassName" title="details" class="method-name">getClassName</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">mixed</span>
										<a href="#getContent" title="details" class="method-name">getContent</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getDomainName" title="details" class="method-name">getDomainName</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getMethodName" title="details" class="method-name">getMethodName</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getSectionName" title="details" class="method-name">getSectionName</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getTemplateName" title="details" class="method-name">getTemplateName</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#performAction" title="details" class="method-name">performAction</a>
										()
									</div>
								
				<div class="method-definition">
					<img src="http://users.visudo.com/eddie/media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setDebugLevel" title="details" class="method-name">setDebugLevel</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$int</span>)
									</div>
							</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">53</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The contructor looks for controller.xml and checks to see if modrewrite is  enabled and loads contents of file. it also gets information about the URL.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Controller</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">'controller.xml'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$filename</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetClassName" id="getClassName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getClassName</span> (line <span class="line-number">359</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the class name for the current section. it first checks the &quot;pages&quot;</p>
<p class="description"><p>in controller.xml then it looks at &quot;aliases&quot; then looks for a default  class defined in controller. If all fail it returns false;</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the class name without any extension, php or class.php</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getClassName
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetContent" id="getContent"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getContent</span> (line <span class="line-number">563</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return the content set by performAction</p>
	<ul class="tags">
				<li><span class="field">return:</span> anycontent</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			getContent
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetDomainName" id="getDomainName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getDomainName</span> (line <span class="line-number">223</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the base domain name of application as defined in controller</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getDomainName
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetMethodName" id="getMethodName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getMethodName</span> (line <span class="line-number">307</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the method name for the current section. It returns the second item in the</p>
<p class="description"><p>request i.e example.org/classname/method?param=true would return &quot;method&quot;</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> action name</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getMethodName
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetSectionName" id="getSectionName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getSectionName</span> (line <span class="line-number">404</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the section name from the URL name of the section we are in.</p>
<p class="description"><p>First check if it exists in the controller file and if none is specified  in URI, check the controller to see which is the default section</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> is the first path in the URL</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getSectionName
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetTemplateName" id="getTemplateName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">getTemplateName</span> (line <span class="line-number">232</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the template name for the current section defined in controller.</p>
<p class="description"><p>This method uses the class name to determine which template name to return.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getTemplateName
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodperformAction" id="performAction"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">performAction</span> (line <span class="line-number">127</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Load the proper class name, execute the default method in that object if  no method is defined in url. if method is defined in URL, execute that  method and save contents to private variable.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			performAction
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodsetDebugLevel" id="setDebugLevel"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="http://users.visudo.com/eddie/media/images/Method.png" />
		<span class="method-title">setDebugLevel</span> (line <span class="line-number">577</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set the level of debug information to print to screen.</p>
<p class="description"><p>(before any action is performed. The levels are:  Level 1: URL, Section, Class, Method, Alias, Get Variables, Template  Level 2: N/A  Level 3: N/A  Level 4: Privilaged User Information  Level 5: Form Data (not complete)  Setting the highest level will print all the information from all previous  levels</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setDebugLevel
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$int</span>)
			</div>
	
		
		
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 17 Nov 2005 22:12:29 -0500 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: PHP Controller