-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-lo.html
More file actions
243 lines (210 loc) · 15.7 KB
/
index-lo.html
File metadata and controls
243 lines (210 loc) · 15.7 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Learning C++ by Creating Games with UE4 - Chapter 3. Looping</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!-- Custom CSS -->
<link href="css/simple-sidebar.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<link href="css/general.css" rel="stylesheet">
<link href="css/bootstrap-xl.css" rel="stylesheet">
<!-- Prism -->
<link rel="stylesheet" href="css/prism.css">
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Roboto:300,400,700|Merriweather:400,700' rel='stylesheet' type='text/css'>
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="language-markup">
<div id="wrapper">
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog login-modal" role="document">
<div class="modal-content">
<div class="modal-body">
<h2 class="text-center" id="myModalLabel">Sign In</h2>
<form ng-submit="login()" class="form-signin ng-pristine ng-valid">
<input name="email" type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
<input name="password" type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
<div class="form-group">
<a href="/account/password" target="_self" class="small">Forgotten Password?</a>
</div>
<div class="alert alert-danger login-error ng-binding" role="alert" style="display: none;">
Sorry, you entered an invalid email address and password combination. <a href="/account/password" target="_self">Have you forgotten your password?</a>
</div>
<input type="submit" class="btn btn-primary btn-block btn-lg" value="Submit">
</form>
</div>
<div class="modal-footer">
<a role="button" href="#" data-toggle="modal" data-target="#accountModal">Create a New Account</a>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="accountModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog account-modal" role="document">
<div class="modal-content">
<div class="modal-body">
<h2 class="text-center" id="myModalLabel">Create Account</h2>
<form ng-submit="login()" class="form-signin ng-pristine ng-valid">
<input name="name" type="name" class="form-control mb20" id="firstName" placeholder="First Name">
<input name="email" type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter Email">
<input name="password" type="password" class="form-control" id="exampleInputPassword1" placeholder="Choose Password">
<div class="form-group">
<div class="checkbox ml10">
<label class="pl10">
<input type="checkbox" value="" checked>
</label><small>Untick this box if you don't want to receive news and promotions</small>
</div>
<div class="g-recaptcha" data-sitekey="6Lc9ZRITAAAAAB3_JIdLV2juRqjDxoN9PZMsTq52"></div>
<p class="mt15"><small>By clicking 'Create Account', you are agreeing to our <a href="books/info/packt/privacy">Policy</a> and <a href="books/info/packt/terms-and-conditions">Terms & Conditions</a></small></p>
</div>
<div class="alert alert-danger login-error ng-binding" role="alert" style="display: none;">
Sorry, you entered an invalid email address and password combination. <a href="/account/password" target="_self">Have you forgotten your password?</a>
</div>
<input type="submit" class="btn btn-primary btn-block btn-lg" value="Create Account">
</form>
</div>
<div class="modal-footer">
<a role="button" href="#" data-toggle="modal" data-target="#myModal">Back to Login</a>
</div>
</div>
</div>
</div>
<!-- Top Nav Bar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="library.html"><img class="brand-logo" src="images/white-packt.png"/></a>
<a class="navbar-brand toggle-nav" href="#menu-toggle" id="menu-toggle"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span></a> </div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="library.html">Library</a></li>
<li><a href="https://www.packtpub.com">Store</a></li>
<li><button data-toggle="modal" data-target="#myModal" type="button" class="btn btn-info navbar-btn mr5">Sign in</button></li>
</ul>
<form class="navbar-form navbar-right search-nav-collapse">
<div class="form-group pull-right" style="display:inline;">
<div class="input-group">
<input class="form-control" type="text" placeholder="Search the library...">
<span class="input-group-btn"><a href="search.html" class="btn btn-default" type="button"><span class="glyphicon glyphicon-search"></span></a></span>
</div>
</div>
</form>
</div><!--/.nav-collapse -->
</div>
</nav>
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<ul id="toc" class="nav nav-tabs mt15" role="tablist">
<li class="active ml15" style="text-indent: 0px;">
<a href="#contents" id="contents-tab" role="tab" data-toggle="tab" aria-controls="contents" aria-expanded="true">Contents</a>
</li>
</ul>
<div id="TocContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade in active pt15" id="contents" aria-labelledby="contents-tab">
<form class="col-sm-12 mt15 mb15">
<input type="text" class="form-control" placeholder="Search this title..." id="box">
</form>
<div class="clearfix"></div>
<li><a href="front-page.html">Learning C++ by Creating Games with UE4</a></li>
<li><a href="#" class="completed-section">Preface</a></li>
<li><a href="#" class="completed-section">1. Preparing your Data</a></li>
<li><a class="completed-section" href="#">2. Driving Visual Analysis with Automated Automobiles</a></li>
<li class="active"><a href="index.html">3. Looping</a></li>
<li class="sub-nav"><a href="for-loop.html">The for loop</a></li>
<li class="sub-nav"><a href="#" class="completed-section">The for/while loop</a></li>
<li class="sub-nav"><a href="#">The 'if' loop</a></li>
<li class="sub-nav"><a href="#">Looping with Unreal Engine</a></li>
<li><a href="#">4. Forms and Entries</a></li>
<li><a href="#">5. Functions and Macros</a></li>
<li><a href="#">6. Dynamic Memory Allocation</a></li>
<li><a href="#">7. If, Else and Switch</a></li>
<li><a href="#">8. Actors and Roles</a></li>
</div>
</div>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<div id="page-content-wrapper" class="book-page ng-scope">
<!-- ngInclude: --><div id="book-wrapper" onload="finishLoad()" ng-include="" src="views.book" class="ng-scope container-fluid">
<div class="reader-container col-sm-12 col-lg-offset-1 col-lg-10 col-xl-offset-2 col-xl-8 ng-scope">
<div class="row">
<div class="btn-group mb10" role="group">
<button type="button" class="btn btn-default">
<i class="fa fa-shopping-cart fa-lg mr5"></i> <span class="hidden-xs"> Buy eBook</span>
</button>
<button href="#" class="btn nightmode-toggle btn-default"><i class="fa fa-moon-o fa-lg"></i></button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-share fa-lg"></i>
</button>
<ul class="dropdown-menu">
<li class="disabled"><a href="#" class="disabled text-center"><b>Share</b></a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Facebook</a></li>
<li><a href="#">Email</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Reddit</a></li>
</ul>
</div>
</div>
<div style="position:relative;" class="book-content" ng-non-bindable="">
<div class="packtlib-version v2"><!--?xml version="1.0" encoding="UTF-8"?-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Creating our first view</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="ch03lvl1sec27"></a>Creating our first view</h2></div></div><hr></div><p>Now that <a id="id89" class="indexterm"></a>we have created our URL and interpreted by the routing system, we must ensure that a view (which is a controller in the MVC pattern) meets the customer's demand.</p><p>This is the function of the second parameter of the URLs present in <code class="literal">urls.py</code>. This parameter will define the method that will play the role of a view. Take, for example, our first URL: </p><div class="informalexample"><pre class="programlisting language-markup">url (r'^$', 'TasksManager.views.index.page'), </pre></div><p>Firstly, as we have seen when studying regular expressions, this URL will be valid only if we browse the <code class="literal">http://localhost:8000</code> URL. The second parameter in the URL means that in the <code class="literal">index.py</code> file, there is a method called <code class="literal">page</code> that will process the request. In our <code class="literal">index.py</code> file, we will create a method called <code class="literal">page()</code>. This method will return an HTML page<a id="id91" class="indexterm"></a> to the client. The page is being returned by the HTTP protocol, so we will use the <code class="literal">HttpResponse()</code> function and its importation. The argument of this <code class="literal">HttpResponse()</code> function returns the HTML content that we will return<a id="id92" class="indexterm"></a> to the browser. To simplify reading this example, we do not use a proper HTML structure, because we just return <code class="literal">Hello world!</code> to the client, as shown in the following code:</p> </div>
</div><div class="fade_out"></div> </div>
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><i class="fa fa-lock" style="margin-right:10px;"></i> Please <a href="#" data-toggle="modal" data-target="#myModal">Sign in</a> to view the full section</span>
</h4>
</div>
</div>
</div>
<div class="row">
<hr>
<span class="hidden-xs"><h4 class="pull-left"><strong>Up Next: </strong>Routing in Django</h4><a href="for-loop.html" class="btn btn-primary pull-right">Next Section</a></span>
<span class="visible-xs"><a href="for-loop.html" class="btn btn-primary btn-block btn-lg">Next Section</a></span>
</div>
<div class="row">
<hr>
</div>
</div></div>
<div class="text-center col-sm-12 mb20">
<small>ISBN 9781783983704 © Packt Publishing Limited. All Rights Reserved </small>
</div>
</div>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- JAVASCRIPT BLOCKS -->
<!-- jQuery Script-->
<script src="js/jquery.js"></script>
<!-- Syntax Highlighting Script -->
<script src="js/prism.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Sidebar Toggle Script -->
<script src="js/simple-sidebar.js"></script>
</body>
</html>