This repository was archived by the owner on Jun 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilities.html
More file actions
126 lines (103 loc) · 3.23 KB
/
utilities.html
File metadata and controls
126 lines (103 loc) · 3.23 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Metody użytkowe | codeigniter-base-model</title>
<style type='text/css' media='all'>@import url('./userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<script src="js/jquery.min.js"></script>
<script src="js/nav.js"></script>
</head>
<body>
<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner">
<script>
create_menu('null');
</script>
</div></div>
<div id="nav2"><a name="top"> </a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>Dokumentacja</h1></td>
<td id="breadcrumb_right"></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->
<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="https://github.com/jamierumbelow/codeigniter-base-model">codeigniter-base-model</a> ›
<a href="index.html">Dokumentacja</a> ›
Metody użytkowe
</td>
</tr>
</table>
<!-- END BREADCRUMB -->
<br clear="all" />
<!-- START CONTENT -->
<div id="content">
<h1>codeigniter-base-model</h1>
<h2>Metody użytkowe</h2>
<a name="dropdown"></a>
<h2>dropdown()</h2>
<p>Pobiera dane z tabeli i generuje tablicę przyjazną funkcji form_dropdown
<pre>
//w kontrolerze
$this->load->helper('form');
$data['dropdown']=$this->pages->dropdown('title');
//w widoku
echo form_dropdown('pages', $dropdown, set_value('pages'));
</pre>
<a name="count_by"></a>
<h2>count_by()</h2>
<p>Pobiera ilość wyników na podstawie zapytania WHERE.
<pre>
$this->post_model->count_by('status','draft');
</pre>
<a name="count_all"></a>
<h2>count_all()</h2>
<p>Pobiera wszystkie wyniki, bez względu na poprzednie warunki.
<pre>
$ilu=$this->author_model->count_all();
</pre>
<a name="skip_validation"></a>
<h2>skip_validation()</h2>
<p>Mówi klasie,żeby nie walidowała danych przy wprowadzaniu.
<pre>
$this->user_model->skip_validation();
$this->user_model->insert(array( 'email' => 'blah' ));
</pre>
Alternatively, pass through a TRUE to insert():
<p>Możesz także ominąć walidację dodając parametr TRUE przy dodawaniu rekordu:
<pre>
$this->user_model->insert(array( 'email' => 'blah' ), TRUE);
</pre>
<a name="get_next_id"></a>
<h2>get_next_id()</h2>
<p>Zwraca następną wartość autoinkrementacji tabeli. Funkcja testowna wyłącznie w MySql.
<pre>
$next_id=$this->post_model->get_next_id();
</pre>
<a name="table"></a>
<h2>table()</h2>
<p>Pobiera nazwę tabeli.
<pre>
$table_name=$this->author_model->table();
</pre>
</div>
<!-- END CONTENT -->
<div id="footer">
<p>
<a href="#top">Top of Page</a> ·
<a href="#">User Guide Home</a>
</p>
<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2014 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
</div>
</body>
</html>