<commit_before><h2>PHPUnit testing</h2>

<p>OK (34 tests, 82 assertions)</p>

<h2>How to use this MVC</h2>

<h3>Directory structure</h3>

<pre>
MVC
|-- Library
|   |
|   |-- Core
|   |
|   |-- MyProject
|   |   |-- Cache
|   |   |-- Controller
|   |   |-- Layout
|   |   |-- Model
|   |   |-- View
|   |   |   |-- Helper
|   |   |   |-- Partial
|   |   |   `-- Script
|   |   |
|   |   |-- Bootstrap.class.php
|   |   `-- config.ini
|   |
|   |-- autoloader.php
|   `-- global.php
|
`-- Web
    |-- assets
    |   |-- css
    |   |-- img
    |   `-- js
    |
    |-- .htaccess
    `-- index.php</pre>

<hr />

<h3>Setup</h3>

<p>Your project configuration files are in /Library/MyProject/config.ini</p>

<hr />

<h3>Routing</h3>

<p>We parse URI's such as <code>/index/hello/my/variables/go/here/foobar</code> and place it into the GET array. Dumping <code>$_GET</code> will give you:

<pre>array(
	'controller' => 'index',
	'action'     => 'hello',
	'my'         => 'variables',
	'go'         => 'here',
	'foobar'     => true
)</pre>

<p>This will forward the request onto the <code>index</code> controller and into the <code>hello</code> action.</p>

<hr />

<h3>Controllers</h3>

<p>Controllers are created in <code>/Library/MyProject/Controller</code>, the file name begins with an uppercase letter and ends in a <code>.class.php</code> extension, so <code>index</code> would be called <code>Index.class.php</code>.</p>

<h4>Actions</h4>

<p>Actions are named the same as specified in the URI, are lowercase, and end in <code>Action</code>. So the <code>index</code> action will be named <code>indexAction()</code>.</p>

<h4>Caching</h4>

<p>Caching can be turned on or off from your projects configuration file (<code>/Library/MyProject/config.ini</code>), and you can set how long you want before the cache is invalidated.</p>

<pre>[cache]
    enable = true
    life   = 60</pre>

<h4>Forwarding</h4>

<p>You can forward to another action (or controller) via the <code>$this->forward('action', 'controller')</code> command in a controller.</p>

<h4>Layouts</h4>

<p>You can change the layout (layouts are stored in <code>/Library/MyProject/Layout</code>, are lowercase, and end with a <code>.phtml</code> extension) that will wrap the View by calling the <code>$this->setLayout('layout')</code> method in a controllers action.</p>

<h4>Example</h4>

<pre>&lt;?php
class Index extends Core\Controller
{
	public function indexAction() {
		$this->setLayout('new-layout');
		$this->forward('hello');
	}

	public function helloAction() {
		// This is the function that will be rendered to the browser
	}
}</pre>

<hr />

<h3>Views</h3>

<p>Views are stored in the <code>/Library/MyProject/View</code> directory, and each controller has their own directory. So the <code>Index</code> controller's views will be stored in <code>/Library/MyProject/View/Index</code>. Each of the controllers actions have a separate view, so the <code>Index</code> controller's <code>hello</code> action will be stored in <code>/Library/MyProject/View/Index/hello.phtml</code>.</p><commit_msg>Fixing an incorrect documentation statement.<commit_after><h2>PHPUnit testing</h2>

<p>OK (34 tests, 82 assertions)</p>

<h2>How to use this MVC</h2>

<h3>Directory structure</h3>

<pre>
MVC
|-- Library
|   |
|   |-- Core
|   |
|   |-- MyProject
|   |   |-- Cache
|   |   |-- Controller
|   |   |-- Layout
|   |   |-- Model
|   |   |-- View
|   |   |   |-- Helper
|   |   |   |-- Partial
|   |   |   `-- Script
|   |   |
|   |   |-- Bootstrap.class.php
|   |   `-- config.ini
|   |
|   |-- autoloader.php
|   `-- global.php
|
`-- Web
    |-- assets
    |   |-- css
    |   |-- img
    |   `-- js
    |
    |-- .htaccess
    `-- index.php</pre>

<hr />

<h3>Setup</h3>

<p>Your project configuration files are in /Library/MyProject/config.ini</p>

<hr />

<h3>Routing</h3>

<p>We parse URI's such as <code>/index/hello/my/variables/go/here/foobar</code> and place it into the GET array. Dumping <code>$_GET</code> will give you:

<pre>array(
	'controller' => 'index',
	'action'     => 'hello',
	'my'         => 'variables',
	'go'         => 'here',
	'foobar'     => true
)</pre>

<p>This will forward the request onto the <code>index</code> controller and into the <code>hello</code> action.</p>

<hr />

<h3>Controllers</h3>

<p>Controllers are created in <code>/Library/MyProject/Controller</code>, the file name begins with an uppercase letter and ends in a <code>.class.php</code> extension, so <code>index</code> would be called <code>Index.class.php</code>.</p>

<h4>Actions</h4>

<p>Actions are named the same as specified in the URI, are lowercase, and end in <code>Action</code>. So the <code>index</code> action will be named <code>indexAction()</code>.</p>

<h4>Caching</h4>

<p>Caching can be turned on or off from your projects configuration file (<code>/Library/MyProject/config.ini</code>), and you can set how long you want before the cache is invalidated.</p>

<pre>[cache]
    enable = true
    life   = 60</pre>

<h4>Forwarding</h4>

<p>You can forward to another action (or controller) via the <code>$this->forward('action', 'controller')</code> command in a controller.</p>

<h4>Layouts</h4>

<p>You can change the layout (layouts are stored in <code>/Library/MyProject/Layout</code>, are lowercase, and end with a <code>.phtml</code> extension) that will wrap the View by calling the <code>$this->setLayout('layout')</code> method in a controllers action.</p>

<h4>Example</h4>

<pre>&lt;?php
class Index extends Core\Controller
{
	public function indexAction() {
		$this->setLayout('new-layout');
		$this->forward('hello');
	}

	public function helloAction() {
		// This is the function that will be rendered to the browser
	}
}</pre>

<hr />

<h3>View Scripts</h3>

<p>Views are stored in the <code>/Library/MyProject/View/Script</code> directory, and each controller has their own directory. So the <code>Index</code> controller's views will be stored in <code>/Library/MyProject/View/Script/Index</code>. Each of the controllers actions have a separate view, so the <code>Index</code> controller's <code>hello</code> action will be stored in <code>/Library/MyProject/View/Script/Index/hello.phtml</code>.</p>
{'fraction_non_alphanumeric': 0.17109714838086032, 'fraction_numerical': 0.009666505558240696, 'mean_word_length': 3.311111111111111, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 219, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '389661', 'n_tokens_mistral': 2195, 'n_tokens_neox': 2148, 'n_words': 602}