-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathareas.html
197 lines (156 loc) · 9.37 KB
/
areas.html
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
195
196
197
<!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">Creating Area</span>
<br>
<div class="row">
<div class="col-lg-8">
<ul class="hash-toc">
<li>Contents
<ul>
<li><a href="#about">About Creating Area</a></li>
<li><a href="#area-controller">Area in Controllers</a></li>
<li><a href="#area-view">Area in Views</a></li>
<li><a href="#area-redirect">Redirect to Area</a></li>
</ul>
</li>
</ul>
</div>
<!--Required Namespace -->
<div class="col-lg-4">
</div>
<!--end: Required Namespace -->
</div>
<br><br>
<!--start: topic-->
<h4 id="about">About Creating Area <small><a href="#content">#top</a></small></h4>
<p>
Ness framework supports creating areas. In Ness framework an area means a smaller functional unit of your project. You can create areas in controllers folder for dividing the business logic of your application. This topic will guide you to create a unit using areas and manage your view files for controllers in areas.
</p>
<br>
<!--end: topic-->
<!--start: topic-->
<h4 id="area-controller">Area in Controllers <small><a href="#content">#top</a></small></h4>
<p>
For creating an area you need to create a sub-folder in controllers folder. If you need to divide your project for admin backend you need to follow the steps below.
<ol style="list-style: circle;">
<li>Create a sub-folder in 'Controller' folder.</li>
<li>Your folder name must contain the Area suffix</li>
<li>Create controllers in your area</li>
</ol>
<br><br>
Let's say we need to create an admin panel. In controllers folder we need to
create a folder called 'adminArea'. The rest part is the same logic with creating <a href="controllers.html">controllers</a> You can check controllers for
more information.
</p>
<br>
<!--end: topic-->
<!--start: topic-->
<h4 id="area-view">Area in Views <small><a href="#content">#top</a></small></h4>
<p>
It is not necessary to create a sub-view folder for every area but you can create folders under 'View' path. By this way you can divide the views and controllers for smaller units.
</p>
<br>
<!--end: topic-->
<!--start: topic-->
<h4 id="area-redirect">Redirect to Area <small><a href="#content">#top</a></small></h4>
<p>
Redirecting to controllers in areas you need to use the following method; Assume that you need to redirect your user to admin panel's login page. Create a tag and in href attribute print the url by this method:
<pre>
<code class="html">
/** OTHER CODES **/
<a href=" <?= Ness\Url::RedirectToArea("areaName", "ControllerName", "ActionName", "optianl-Parameters for function"); ?>"> Link Name < /a>
< a href=" <?= Ness\Url::RedirectToArea("admin", "user", "login"); ?>"> Admin Login < /a>
/** OTHER CODES **/
the code above will return a string to href attribute:
http://sitename.com/user/login/?p=admin
</code>
</pre>
</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>