-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstructure.html
More file actions
194 lines (156 loc) · 11.5 KB
/
structure.html
File metadata and controls
194 lines (156 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ness PHP Framework | Docs</title>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/fnt-aw/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!--Load highlightjs package -->
<link rel="stylesheet" href="assets/js/highlightjs/styles/vs2015.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<div class="wrapper">
<!-- Sidebar -->
<nav id="sidebar">
<div id="sidebar-header" class="text-center">
<br>
<a href="index.html" id="logo-area-link">
<img src="assets/img/nessphp_bordered.png" alt="Ness PHP Documentation" width="70%"/>
<h3>Ness PHP</h3>
<h4>Documentation</h4>
</a>
<a href="index.html" class="btn btn-light btn-sm" style="width: 100%;">
<i class="fa fa-angle-left" aria-hidden="true"></i> Back
</a>
</div>
<br>
<!--Load LATER-->
<div id="sidebar-loader" class="sidebar-contents">
</div>
</nav>
<div id="content">
<!--Nabvar:start-->
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<button id="sidebarCollapse" class="btn-circle">
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
<ul class="nav navbar-nav">
<li class="nav-item">
<a href="index.html" class="navbar-text-header">
Ness PHP Framework
</a>
</li>
</ul>
<button class="btn-circle d-inline-block d-lg-none ml-auto" type="button" data-toggle="collapse" data-target="#headernav-links" aria-controls="headernav-links" aria-expanded="false" aria-label="Toggle Menu">
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
</button>
<div class="collapse navbar-collapse" id="headernav-links">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link " href="https://nessphp.github.io/">
<i class="fa fa-terminal" aria-hidden="true"></i>
Ness PHP
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="https://github.com/nessphp/application">
<i class="fa fa-github" aria-hidden="true"></i>
GitHub
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="support.html">
<i class="fa fa-heart" aria-hidden="true"></i>
Support
</a>
</li>
</ul>
</div>
</div>
</nav>
<!--Nabvar:end-->
<!-- ========================content:start======================== -->
<div id="holder">
<span class="pageheader">Directory & URL Structure of Ness PHP Framework</span>
<br>
<ul class="hash-toc">
<li>Contents
<ul>
<li><a href="#directory">Directory Structure</a></li>
<li><a href="#url">URL Structure</a></li>
</ul>
</li>
</ul>
<br><br>
<!--start: topic-->
<h4 id="directory">Directory Structure <small><a href="#content">#top</a></small></h4>
<p>
Ness PHP's directory structure is not confusing. All folders and paths organised hierarchically and described
clearly with folder names. You can clearly understand at a glance which folder is for what. Here is a short
description for each folder available in Ness PHP project.
<div class="text-center">
<img src="assets/img/directory_structure.png" width="70%">
</div>
<br><br>
<br><br>
<span class="badge badge-dark">index.php:</span> This file is the most important file of your application, we can call it entry point for your application. All configurations and url analyzes are made here for first time.<br>
<span class="badge badge-dark">app_config.php:</span> This files contains some configurations of your project<br>
<span class="badge badge-dark">composer.json:</span> Required for composer.<br><br>
<span class="badge badge-dark">Ness:</span> This folder contains core framework files and core framework code of the Ness PHP. You can use files in this path to extent the framework.<br>
<span class="badge badge-dark">Application:</span> All your project resources are available in this path. You can write your application's code in the required paths described below.<br>
<span class="badge badge-dark">Application/Content:</span> This folder contains some sub folders for some resources like; images, style sheets, javascript files, html widgets and file upload path for using with ContentManager class which is described in this documentation. You can use ContentManager for including each file type in your project with a single line of code.<br>
<span class="badge badge-dark">Application/Config:</span> This folder is used to store some user-created configuration files. You can create any class or variable in Config path then load to your app with Ness PHP's Library class.<br>
<span class="badge badge-dark">Application/Language:</span> Define language files for creating multilingual applications with help of Ness PHP Language helper class.<br>
<span class="badge badge-dark">Application/Library:</span> Sometimes you will need to use third party codes or your own classes. In this case you must put all third party libraries here to include them in your code. Ness PHP has a function to load libraries when you need.<br>
<span class="badge badge-dark">Application/Model:</span> Used to store 'Model' classes.<br>
<span class="badge badge-dark">Application/Output:</span> This folder contains 3 text files. This files are automatically generated by your code and holds the Errors, Warnings and output messages.<br>
<span class="badge badge-dark">Application/Template:</span> Ness PHP framework has a templating engine. if you want to avoid code repetition you can create a template and use them with your views. All your html templates must be located in this folder. Please read topic related to template engine for getting more.<br>
<span class="badge badge-dark">Application/View:</span> View files of your application must be in this folder. You can use sub folders to separate the parts of your website.<br>
<span class="badge badge-dark">Application/Controller:</span> All your controllers should be in this folder. When you make a request, according to your url the framework will find a controller to respond.<br>
<div class="alert alert-info">
<strong>Information</strong> All folders contains an index.html file for preventing directory listing. Please do not forget to copy/paste an index.html file if you create a new directory in your project root.
</div>
</p>
<br>
<!--end: topic-->
<!--start: topic-->
<h4>URL Structure <small><a href="#content">#top</a></small></h4>
<p>
Ness PHP framework generates URLs automatically by analyzing your controllers. There is no need to write Routes in Ness PHP. By this way you can gain time while your projects. Just create a controller and controller's actions for creating meaninful urls in Ness.
<br>
http://www.examplesite.com/ <span class="badge badge-primary">[controller]</span> / <span class="badge badge-success">[method]</span> / <span class="badge badge-dark">[parameter]</span>
<br><br>
<strong>Example Controller</strong><br>
<pre><code class="php"><?php
use Ness\Controller as myController;
class indexController extends myController
{
public function indexAction($param = 0)
{
$this->View->Render('startpage.php');
}
public function printAction($param = 'Hello World')
{
$this->Content->Render("Hey your parameter is; {$param}");
}
}
</code></pre>
If we navigate to http://www.examplesite.com/ or http://www.examplesite.com/index the indexAction runs. If we navigate to http://www.examplesite.com/print the output will Hey your parameter is;, if we navigate to http://www.examplesite.com/print/hello the output will; Hey your parameter is; hello
</p>
<br>
<!--end: topic-->
</div>
<!-- ========================content:end======================== -->
</div>
</div>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/nessphp.js"></script>
<script src="assets/js/highlightjs/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>