Location: PHPKode > projects > Thought Push PHP Framework > instance/display/templates/quickStart.php
<div class="sectionTitle">Quick Start Guide</div>
<div class="sub">
	<p>
		Sometimes it is easiest to learn from example; so, the code that makes this site is available at <a href="/exampleDoc/">sample site documentation</a>.
	</p>
	<p>
		Configuration
		<ul>
			<li>Located at "instance/preloading/config.php</li>
			<li><a href="/doc/search.php?query=<?=urlencode('config.template.php')?>">See Docs</a></li>
		</ul>
	</p>
	<p>
		Request Handling, rules:
		<ul>
			<li>Rules are located at deepening path starting at "instance/requestHandling"</li>
			<li>RequestHandler attempts to traverse rule directories based on the url</li>
			<li>To stop the RequestHandler rule directory traversal at any level, set RequestHandler::$stopRules = true.</li>
			<li><a href="/doc/search.php?query=<?=urlencode('rules.sample.php')?>">See docs for rule examples</a></li>
		</ul>
	</p>
	<p>
		Request Handling, controllers
		<ul>
			<li>Controllers are located at deepening path starting at "instance/controllers"</li>
			<li>RequestHandler attempts to traverse controller directories based on the url</li>
			<li>To stop the RequestHandler controller directory traversal at any level, set RequestHandler::$stopControls = true.</li>
		</ul>
	</p>
	<p>
		Controllers
		<ul>
			<li>Autoload functionality default allows all utility directories to be autoloaded; so if you want to use a tool, just use it.</li>
			<li>After dealing with the business logic, include templates by the use of the <a href="/doc/search.php?query=<?=urlencode('Display::show')?>">Display::show</a> function (<a href="">Example</a>).</li>
			<li>The controllers/controller.php will almost always be called.  Include any ubiquitous code there; like <a href="/doc/search.php?query=<?=urlencode('Session.php')?>">session handling</a>, <a href="">database initialization</a>, <a href="/doc/search.php?query=<?=urlencode('Cookie.php')?>">cookie stuff</a>, and potentially <a href="/doc/search.php?query=<?=urlencode('config.template.php')?>">display hooks</a>.</li>
		</ul>
	</p>
	<p>
		<a href="/doc/search.php?query=<?=urlencode('Db.php')?>">Database</a>
		<ul>
			<li>Please see warning in documentation on <a href="/doc/search.php?query=<?=urlencode('Db.php')?>">Db file</a></li>
			<li>To use the Db class, first initialize Db with Db::initialize</li>
			<li>You can either use the Db class as an instantiated object or through Db static methods</li>
			<li>Methods are: row, rows, column, list, and columnKey, and update, delete, and insert, insertUpdate, insertIgnore</li>
			<li>When called statically, the methods use a primary Db instance; usually the first initialized Db object.</li>
			<li>To get the last SQL sent to the database, echo Db::$lastSql</li>
		</ul>
	</p>
	<p>
		Display
		<ul>
			<li>Include templates with <a href="/doc/search.php?query=<?=urlencode('Display::show')?>">Display::show</a></li>
			<li>Add resources by <a href="/doc/search.php?query=<?=urlencode('Display::addCss')?>">Display::addCss</a>,<a href="/doc/search.php?query=<?=urlencode('Display::addJs')?>">Display::addJs</a></li>
			<li>Display resources in templates by <a href="/doc/search.php?query=<?=urlencode('Display::getCss')?>">Display::getCss</a>, Display::addJs</li>
			<li>If you want to use templating like other frameworks (linear, sequential template display), use <a href="/doc/search.php?query=<?=urlencode('Display::getTemplate')?>">Display::getTemplate</a> instead of Display::show</li>
		</ul>
	</p>
	<p>
		Templates
		<ul>
			<li>No special language is used for templates.  However, following the PHP and HTML section of the <a href="/philosophy#philosophy-coding_guidelines-coding_standards">coding standards</a> would be nice</li>
			<li>For using forms in a template, consider using the <a href="/doc/search.php?query=<?=urlencode('Form.php')?>">Form</a> class</li>
		</ul>
	</p>
	<p>
		Sessions
		<ul>
			<li>To use system Session class, start a session with Session::start()</li>
			<li>
				If you want to sue the database for sessions, set <a href="/doc/search.php?query=<?=urlencode('config.template.php')?>">$config['sessionUseDb']</a>.  There are some things to note when using database sessions:
				<ul>
					<li>You must define the session table with $config['sessionDbTable']</li>
					<li>The session table must have columns "id", "data", "time"</li>
					<li>If you want to add more data to the session table, you can modify the <a href="/doc/search.php?query=<?=urlencode('Session.php')?>">Session::$insert</a> in the controllers, and the Session class will try to insert those values</li>
				</ul>
			</li>
			<li>The Session class tries to validate sessions based on ip and user agent.  If it finds an invalid session, it will wither not open the session (<a href="/doc/search.php?query=<?=urlencode('Session.php')?>">Session::$start</a> = false), or it will start a new session (Session::$start = true)</li>
		</ul>
	</p>
	<p>
		Cookies
		<ul>
			<li>System Cookie class allows default cookie settings with call based overrides</li>
			<li>Cookie will also set and unset $_COOKIE when it's methods are called</li>
			<li>See <a href="/doc/search.php?query=<?=urlencode('Cookie::set')?>">Cookie::set</a> and <a href="/doc/search.php?query=<?=urlencode('Cookie::remove')?>">Cookie::remove</a></li>
		</ul>
	</p>
	<p>
		Debugging
		<ul>
			<li>Log is located at "instance/info/log"</li>
			<li>To throw/trigger at system like error message, use <a href="/doc/search.php?query=<?=urlencode('Debug::throwError')?>">Debug::throwError</a></li>
			<li>To log something to the log, use <a href="/doc/search.php?query=<?=urlencode('Debug::toLog')?>">Debug::toLog</a></li>
			<li>To print a variable with some useful context information, use <a href="/doc/search.php?query=<?=urlencode('Debug::out')?>">Debug::out</a></li>
			<li>To do some benchmarking, use <a href="/doc/search.php?query=<?=urlencode('Debug::measure')?>">Debug::measure</a> and <a href="/doc/search.php?query=<?=urlencode('Debug::measureResults')?>">Debug::measureResults</a></li>
		</ul>
	</p>
	
</div>
Return current item: Thought Push PHP Framework