This uses Twitter Bootstrap classes for CodeIgniter pagination.
Drop this file into application/config.
| If you are new to CodeIgniter you may be confused as to when you need to use get_instance and when you don't, it certainly tripped me up when I first came back to CodeIgniter after leaving the PHP community for some time. | |
| Luckily it is pretty simple to remember. | |
| If you are writing code that lives within a controller, a model or a view that is under CodeIgniter's control then you do not need to use get_instance. | |
| If however you are writing your own custom libraries or something that sits outside of the MVC files then you do need to use it. | |
| So, if you are inside a model you could do something like this; |
This uses Twitter Bootstrap classes for CodeIgniter pagination.
Drop this file into application/config.
| $tmp = $this->inventory_model->select('id')->as_array()->order_by($id, 'asc')->find_all(); | |
| $max = count($tmp); | |
| echo $max; | |
| //$tmp = $this->inventory_model->select('id')->as_array()->order_by($id, 'asc')->find_all(); | |
| //$max = end($tmp); |
| $this->db->insert_id() | |
| //The insert ID number when performing database inserts. | |
| $this->db->affected_rows() | |
| //Displays the number of affected rows, when doing “write” type queries (insert, update, etc.). | |
| $this->db->last_query() | |
| //Returns the last query that was run (the query string, not the result). Example: | |
| $this->db->count_all() |
| if (is_numeric($param)) { | |
| //TRUE | |
| } | |
| else { | |
| //FALSE | |
| } | |
| if (!empty($param)) { | |
| //not empty | |
| } |
| ucfirst(strtolower($row['name'])); |
| <img src="data:image/gif;base64,R0lGODlhAQABAAAAACw=" /> |
| //Load CSS files | |
| Assets::add_css( | |
| array( 'bootstrap/bootstrap-3.3.7.min.css','font-awesome.css', | |
| 'styles.css','mystyles.css', | |
| $data['scheme'] | |
| ) | |
| ); | |
| //Put in header section | |
| echo Assets::css(); |
| Header unset Set-Cookie |
| <?php | |
| Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/ | |
| //adjustments to wp-includes/http.php timeout values to workaround slow server responses | |
| add_filter('http_request_args', 'bal_http_request_args', 100, 1); | |
| function bal_http_request_args($r) //called on line 237 | |
| { | |
| $r['timeout'] = 15; | |
| return $r; | |
| } | |