codeigniter_vender 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. data/.gitignore +2 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +40 -0
  4. data/Rakefile +18 -0
  5. data/VERSION +1 -0
  6. data/codeigniter_vender.gemspec +389 -0
  7. data/generators/ci_app/USAGE +8 -0
  8. data/generators/ci_app/ci_app_generator.rb +12 -0
  9. data/generators/ci_app/templates/CodeIgniter_1.7.2/index.php +118 -0
  10. data/generators/ci_app/templates/CodeIgniter_1.7.2/license.txt +52 -0
  11. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/autoload.php +116 -0
  12. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/config.php +329 -0
  13. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/constants.php +41 -0
  14. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/database.php +55 -0
  15. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/doctypes.php +15 -0
  16. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/hooks.php +16 -0
  17. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/index.html +10 -0
  18. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/mimes.php +105 -0
  19. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/routes.php +48 -0
  20. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/smileys.php +66 -0
  21. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/user_agents.php +175 -0
  22. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/index.html +10 -0
  23. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/welcome.php +17 -0
  24. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_404.php +34 -0
  25. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_db.php +34 -0
  26. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_general.php +34 -0
  27. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_php.php +10 -0
  28. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/index.html +10 -0
  29. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/helpers/index.html +10 -0
  30. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/hooks/index.html +10 -0
  31. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/index.html +10 -0
  32. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/language/english/index.html +10 -0
  33. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/libraries/index.html +10 -0
  34. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/models/index.html +10 -0
  35. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/index.html +10 -0
  36. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/welcome_message.php +62 -0
  37. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/cache/index.html +10 -0
  38. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base4.php +69 -0
  39. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base5.php +56 -0
  40. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/CodeIgniter.php +280 -0
  41. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Common.php +421 -0
  42. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Compat.php +93 -0
  43. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/index.html +10 -0
  44. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB.php +146 -0
  45. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_active_rec.php +1820 -0
  46. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_cache.php +195 -0
  47. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_driver.php +1366 -0
  48. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_forge.php +375 -0
  49. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_result.php +342 -0
  50. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_utility.php +389 -0
  51. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/index.html +10 -0
  52. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/index.html +10 -0
  53. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_driver.php +667 -0
  54. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_forge.php +248 -0
  55. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_result.php +169 -0
  56. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_utility.php +123 -0
  57. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/index.html +10 -0
  58. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_driver.php +670 -0
  59. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_forge.php +254 -0
  60. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_result.php +169 -0
  61. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_utility.php +245 -0
  62. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/index.html +10 -0
  63. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_driver.php +671 -0
  64. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_forge.php +254 -0
  65. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_result.php +169 -0
  66. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_utility.php +123 -0
  67. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/index.html +10 -0
  68. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_driver.php +780 -0
  69. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_forge.php +248 -0
  70. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_result.php +249 -0
  71. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_utility.php +122 -0
  72. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/index.html +10 -0
  73. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_driver.php +639 -0
  74. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_forge.php +266 -0
  75. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_result.php +228 -0
  76. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_utility.php +148 -0
  77. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/index.html +10 -0
  78. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_driver.php +684 -0
  79. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_forge.php +248 -0
  80. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_result.php +169 -0
  81. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_utility.php +124 -0
  82. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/index.html +10 -0
  83. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_driver.php +657 -0
  84. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_forge.php +265 -0
  85. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_result.php +179 -0
  86. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_utility.php +141 -0
  87. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/index.html +10 -0
  88. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/index.html +10 -0
  89. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/texb.ttf +0 -0
  90. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/array_helper.php +78 -0
  91. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/compatibility_helper.php +498 -0
  92. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/cookie_helper.php +144 -0
  93. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/date_helper.php +611 -0
  94. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/directory_helper.php +84 -0
  95. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/download_helper.php +100 -0
  96. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/email_helper.php +62 -0
  97. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/file_helper.php +464 -0
  98. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/form_helper.php +1025 -0
  99. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/html_helper.php +416 -0
  100. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/index.html +10 -0
  101. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/inflector_helper.php +171 -0
  102. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/language_helper.php +58 -0
  103. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/number_helper.php +75 -0
  104. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/path_helper.php +72 -0
  105. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/security_helper.php +126 -0
  106. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/smiley_helper.php +273 -0
  107. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/string_helper.php +273 -0
  108. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/text_helper.php +462 -0
  109. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/typography_helper.php +71 -0
  110. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/url_helper.php +593 -0
  111. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/xml_helper.php +62 -0
  112. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/index.html +10 -0
  113. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/calendar_lang.php +51 -0
  114. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/date_lang.php +60 -0
  115. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/db_lang.php +28 -0
  116. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/email_lang.php +24 -0
  117. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/form_validation_lang.php +24 -0
  118. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/ftp_lang.php +17 -0
  119. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/imglib_lang.php +24 -0
  120. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/index.html +10 -0
  121. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/number_lang.php +10 -0
  122. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/profiler_lang.php +19 -0
  123. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/scaffolding_lang.php +17 -0
  124. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/unit_test_lang.php +24 -0
  125. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/upload_lang.php +22 -0
  126. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/validation_lang.php +24 -0
  127. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/index.html +10 -0
  128. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Benchmark.php +113 -0
  129. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Calendar.php +477 -0
  130. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Cart.php +550 -0
  131. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Config.php +244 -0
  132. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Controller.php +127 -0
  133. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Email.php +2041 -0
  134. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Encrypt.php +484 -0
  135. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Exceptions.php +174 -0
  136. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Form_validation.php +1278 -0
  137. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Ftp.php +618 -0
  138. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Hooks.php +226 -0
  139. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Image_lib.php +1544 -0
  140. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Input.php +1067 -0
  141. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Language.php +123 -0
  142. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Loader.php +1085 -0
  143. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Log.php +117 -0
  144. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Model.php +83 -0
  145. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Output.php +409 -0
  146. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Pagination.php +244 -0
  147. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Parser.php +173 -0
  148. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Profiler.php +392 -0
  149. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Router.php +389 -0
  150. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Session.php +758 -0
  151. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Sha1.php +251 -0
  152. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Table.php +440 -0
  153. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Trackback.php +547 -0
  154. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Typography.php +406 -0
  155. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/URI.php +586 -0
  156. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Unit_test.php +347 -0
  157. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Upload.php +970 -0
  158. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/User_agent.php +502 -0
  159. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Validation.php +875 -0
  160. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpc.php +1421 -0
  161. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpcs.php +536 -0
  162. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Zip.php +359 -0
  163. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/index.html +10 -0
  164. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/logs/index.html +10 -0
  165. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/captcha_pi.php +356 -0
  166. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/index.html +10 -0
  167. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/js_calendar_pi.php +629 -0
  168. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/Scaffolding.php +291 -0
  169. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/background.jpg +0 -0
  170. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/index.html +10 -0
  171. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/logo.jpg +0 -0
  172. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/index.html +10 -0
  173. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/add.php +32 -0
  174. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/delete.php +9 -0
  175. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/edit.php +33 -0
  176. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/footer.php +10 -0
  177. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/header.php +29 -0
  178. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/index.html +10 -0
  179. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/no_data.php +8 -0
  180. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/stylesheet.css +143 -0
  181. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/view.php +27 -0
  182. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/changelog.html +1080 -0
  183. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/active_record.html +757 -0
  184. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/caching.html +220 -0
  185. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/call_function.html +118 -0
  186. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/configuration.html +157 -0
  187. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/connecting.html +186 -0
  188. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/examples.html +217 -0
  189. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/fields.html +163 -0
  190. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/forge.html +234 -0
  191. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/helpers.html +151 -0
  192. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/index.html +99 -0
  193. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/queries.html +153 -0
  194. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/results.html +238 -0
  195. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/table_data.html +113 -0
  196. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/transactions.html +200 -0
  197. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/utilities.html +295 -0
  198. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/index.html +86 -0
  199. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/template.html +128 -0
  200. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/alternative_php.html +147 -0
  201. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/ancillary_classes.html +117 -0
  202. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/autoloader.html +101 -0
  203. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/caching.html +115 -0
  204. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/common_functions.html +119 -0
  205. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/controllers.html +385 -0
  206. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/core_classes.html +185 -0
  207. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/creating_libraries.html +298 -0
  208. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/credits.html +86 -0
  209. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/errors.html +138 -0
  210. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/helpers.html +185 -0
  211. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/hooks.html +167 -0
  212. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/libraries.html +94 -0
  213. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/managing_apps.html +133 -0
  214. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/models.html +251 -0
  215. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/plugins.html +127 -0
  216. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/profiling.html +104 -0
  217. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/quick_reference.html +77 -0
  218. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/requirements.html +82 -0
  219. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/reserved_names.html +156 -0
  220. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/routing.html +176 -0
  221. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/scaffolding.html +147 -0
  222. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/security.html +153 -0
  223. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/styleguide.html +687 -0
  224. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/urls.html +151 -0
  225. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/views.html +274 -0
  226. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/array_helper.html +119 -0
  227. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/compatibility_helper.html +118 -0
  228. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/cookie_helper.html +147 -0
  229. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/date_helper.html +408 -0
  230. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/directory_helper.html +143 -0
  231. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/download_helper.html +112 -0
  232. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/email_helper.html +102 -0
  233. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/file_helper.html +178 -0
  234. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/form_helper.html +484 -0
  235. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/html_helper.html +385 -0
  236. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/inflector_helper.html +151 -0
  237. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/language_helper.html +98 -0
  238. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/number_helper.html +107 -0
  239. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/path_helper.html +106 -0
  240. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/security_helper.html +125 -0
  241. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/smiley_helper.html +215 -0
  242. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/string_helper.html +176 -0
  243. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/text_helper.html +192 -0
  244. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/typography_helper.html +112 -0
  245. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/url_helper.html +289 -0
  246. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/xml_helper.html +105 -0
  247. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/appflowchart.gif +0 -0
  248. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/arrow.gif +0 -0
  249. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo.jpg +0 -0
  250. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo_flame.jpg +0 -0
  251. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_quick_ref.png +0 -0
  252. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.pdf +0 -0
  253. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.png +0 -0
  254. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.pdf +0 -0
  255. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.png +0 -0
  256. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/file.gif +0 -0
  257. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/folder.gif +0 -0
  258. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_bg_darker.jpg +0 -0
  259. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_separator_darker.jpg +0 -0
  260. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_toggle_darker.jpg +0 -0
  261. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/smile.gif +0 -0
  262. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/transparent.gif +0 -0
  263. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/index.html +99 -0
  264. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/downloads.html +105 -0
  265. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/index.html +97 -0
  266. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/troubleshooting.html +90 -0
  267. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_120.html +92 -0
  268. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_130.html +203 -0
  269. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_131.html +102 -0
  270. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_132.html +100 -0
  271. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_133.html +112 -0
  272. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_140.html +145 -0
  273. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_141.html +148 -0
  274. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_150.html +178 -0
  275. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_152.html +111 -0
  276. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_153.html +100 -0
  277. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_154.html +116 -0
  278. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_160.html +125 -0
  279. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_161.html +98 -0
  280. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_162.html +106 -0
  281. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_163.html +99 -0
  282. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_170.html +121 -0
  283. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_171.html +98 -0
  284. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_172.html +105 -0
  285. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_b11.html +144 -0
  286. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrading.html +101 -0
  287. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/benchmark.html +198 -0
  288. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/calendar.html +249 -0
  289. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/cart.html +346 -0
  290. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/config.html +181 -0
  291. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/email.html +307 -0
  292. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/encryption.html +182 -0
  293. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/file_uploading.html +451 -0
  294. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/form_validation.html +1221 -0
  295. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/ftp.html +303 -0
  296. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/image_lib.html +666 -0
  297. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/input.html +231 -0
  298. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/language.html +137 -0
  299. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/loader.html +214 -0
  300. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/output.html +145 -0
  301. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/pagination.html +218 -0
  302. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/parser.html +208 -0
  303. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/sessions.html +311 -0
  304. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/table.html +292 -0
  305. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/trackback.html +246 -0
  306. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/typography.html +160 -0
  307. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/unit_testing.html +205 -0
  308. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/uri.html +252 -0
  309. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/user_agent.html +201 -0
  310. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/validation.html +740 -0
  311. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/xmlrpc.html +517 -0
  312. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/zip.html +278 -0
  313. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/license.html +107 -0
  314. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/hacks.txt +9 -0
  315. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.js +119 -0
  316. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.pack.js +241 -0
  317. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/nav.js +139 -0
  318. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/prototype.lite.js +127 -0
  319. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/user_guide_menu.js +4 -0
  320. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/appflow.html +95 -0
  321. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/at_a_glance.html +172 -0
  322. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/cheatsheets.html +83 -0
  323. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/features.html +120 -0
  324. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/getting_started.html +92 -0
  325. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/goals.html +98 -0
  326. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/index.html +84 -0
  327. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/mvc.html +100 -0
  328. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/toc.html +209 -0
  329. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/userguide.css +406 -0
  330. data/generators/ci_app/templates/README +1 -0
  331. data/generators/ci_controller/USAGE +2 -0
  332. data/generators/ci_controller/ci_controller_generator.rb +11 -0
  333. data/generators/ci_controller/templates/ci_controller.php.erb +15 -0
  334. data/generators/ci_controller/templates/ci_view.php.erb +8 -0
  335. data/generators/ci_layout/USAGE +2 -0
  336. data/generators/ci_layout/ci_layout_generator.rb +24 -0
  337. data/generators/ci_layout/templates/application_layout.php.erb +19 -0
  338. data/generators/ci_model/USAGE +2 -0
  339. data/generators/ci_model/ci_model_generator.rb +42 -0
  340. data/generators/ci_model/templates/ci_model.php.erb +15 -0
  341. data/generators/ci_model/templates/model.rb +5 -0
  342. data/generators/ci_model/templates/model_migration.rb.erb +16 -0
  343. data/init.rb +1 -0
  344. data/install.rb +1 -0
  345. data/lib/codeigniter_vender.rb +1 -0
  346. data/lib/tasks/app.rake +8 -0
  347. data/test/codeigniter_vender_test.rb +8 -0
  348. data/test/test_helper.rb +3 -0
  349. data/uninstall.rb +1 -0
  350. metadata +411 -0
@@ -0,0 +1,311 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Session Class : CodeIgniter User Guide</title>
7
+
8
+ <style type='text/css' media='all'>@import url('../userguide.css');</style>
9
+ <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
10
+
11
+ <script type="text/javascript" src="../nav/nav.js"></script>
12
+ <script type="text/javascript" src="../nav/prototype.lite.js"></script>
13
+ <script type="text/javascript" src="../nav/moo.fx.js"></script>
14
+ <script type="text/javascript" src="../nav/user_guide_menu.js"></script>
15
+
16
+ <meta http-equiv='expires' content='-1' />
17
+ <meta http-equiv= 'pragma' content='no-cache' />
18
+ <meta name='robots' content='all' />
19
+ <meta name='author' content='ExpressionEngine Dev Team' />
20
+ <meta name='description' content='CodeIgniter User Guide' />
21
+
22
+ </head>
23
+ <body>
24
+
25
+ <!-- START NAVIGATION -->
26
+ <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
27
+ <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
28
+ <div id="masthead">
29
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
30
+ <tr>
31
+ <td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
32
+ <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
33
+ </tr>
34
+ </table>
35
+ </div>
36
+ <!-- END NAVIGATION -->
37
+
38
+
39
+ <!-- START BREADCRUMB -->
40
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
41
+ <tr>
42
+ <td id="breadcrumb">
43
+ <a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
44
+ <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
45
+ Session Class
46
+ </td>
47
+ <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
48
+ </tr>
49
+ </table>
50
+ <!-- END BREADCRUMB -->
51
+
52
+ <br clear="all" />
53
+
54
+
55
+ <!-- START CONTENT -->
56
+ <div id="content">
57
+
58
+
59
+ <h1>Session Class</h1>
60
+
61
+ <p>The Session class permits you maintain a user's "state" and track their activity while they browse your site.
62
+ The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie.
63
+ It can also store the session data in a database table for added security, as this permits the session ID in the
64
+ user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to
65
+ use the database option you'll need to create the session table as indicated below.
66
+ </p>
67
+
68
+ <p class="important"><strong>Note:</strong> The Session class does <strong>not</strong> utilize native PHP sessions. It
69
+ generates its own session data, offering more flexibility for developers.</p>
70
+
71
+ <h2>Initializing a Session</h2>
72
+
73
+ <p>Sessions will typically run globally with each page load, so the session class must either be
74
+ <a href="../general/libraries.html">initialized</a> in your
75
+ <a href="../general/controllers.html">controller</a> constructors, or it can be
76
+ <a href="../general/autoloader.html">auto-loaded</a> by the system.
77
+ For the most part the session class will run unattended in the background, so simply initializing the class
78
+ will cause it to read, create, and update sessions.</p>
79
+
80
+
81
+ <p>To initialize the Session class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p>
82
+
83
+ <code>$this->load->library('session');</code>
84
+ <p>Once loaded, the Sessions library object will be available using: <dfn>$this->session</dfn></p>
85
+
86
+
87
+ <h2>How do Sessions work?</h2>
88
+
89
+ <p>When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie.
90
+ If sessions data does <strong>not</strong> exist (or if it has expired) a new session will be created and saved in the cookie.
91
+ If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.</p>
92
+
93
+ <p>It's important for you to understand that once initialized, the Session class runs automatically. There is nothing
94
+ you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or
95
+ even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.</p>
96
+
97
+
98
+ <h2>What is Session Data?</h2>
99
+
100
+ <p>A <em>session</em>, as far as CodeIgniter is concerned, is simply an array containing the following information:</p>
101
+
102
+ <ul>
103
+ <li>The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)</li>
104
+ <li>The user's IP Address</li>
105
+ <li>The user's User Agent data (the first 50 characters of the browser data string)</li>
106
+ <li>The "last activity" time stamp.</li>
107
+ </ul>
108
+
109
+ <p>The above data is stored in a cookie as a serialized array with this prototype:</p>
110
+
111
+ <code>[array]<br />
112
+ (<br />
113
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'session_id'&nbsp;&nbsp;&nbsp;&nbsp;=> random hash,<br />
114
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ip_address'&nbsp;&nbsp;&nbsp;&nbsp;=> 'string - user IP address',<br />
115
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'user_agent'&nbsp;&nbsp;&nbsp;&nbsp;=> 'string - user agent data',<br />
116
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'last_activity' => timestamp<br />
117
+ )</code>
118
+
119
+ <p>If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie,
120
+ making the data highly secure and impervious to being read or altered by someone. More info regarding encryption
121
+ can be <a href="encryption.html">found here</a>, although the Session class will take care of initializing
122
+ and encrypting the data automatically.</p>
123
+
124
+ <p>Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page
125
+ you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time
126
+ the cookie was written. This time is configurable by changing the $config['time_to_update'] line in your system/config/config.php file.</p>
127
+
128
+ <h2>Retrieving Session Data</h2>
129
+
130
+ <p>Any piece of information from the session array is available using the following function:</p>
131
+
132
+ <code>$this->session->userdata('<samp>item</samp>');</code>
133
+
134
+ <p>Where <samp>item</samp> is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you
135
+ will do this:</p>
136
+
137
+ <code>$session_id = $this->session->userdata('<samp>session_id</samp>');</code>
138
+
139
+ <p><strong>Note:</strong> The function returns FALSE (boolean) if the item you are trying to access does not exist.</p>
140
+
141
+
142
+ <h2>Adding Custom Session Data</h2>
143
+
144
+ <p>A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie.
145
+ Why would you want to do this? Here's one example:</p>
146
+
147
+ <p>Let's say a particular user logs into your site. Once authenticated,
148
+ you could add their username and email address to the session cookie, making that data globally available to you without
149
+ having to run a database query when you need it.</p>
150
+
151
+ <p>To add your data to the session array involves passing an array containing your new data to this function:</p>
152
+
153
+ <code>$this->session->set_userdata(<samp>$array</samp>);</code>
154
+
155
+ <p>Where <samp>$array</samp> is an associative array containing your new data. Here's an example:</p>
156
+
157
+
158
+ <p><code>$newdata = array(<br />
159
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'username'&nbsp; => 'johndoe',<br />
160
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'johndoe@some-site.com',<br />
161
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'logged_in' => TRUE<br />
162
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
163
+ <br />
164
+ $this->session->set_userdata(<samp>$newdata</samp>);</code></p>
165
+ <p>If you want to add userdata one value at a time, set_userdata() also supports this syntax. </p>
166
+ <p><code>$this-&gt;session-&gt;set_userdata('some_name', 'some_value');</code></p>
167
+ <p class="important"><strong>Note:</strong> Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The
168
+ encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.</p>
169
+
170
+ <h2>Removing Session Data</h2>
171
+ <p>Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information: </p>
172
+ <p><code>$this-&gt;session-&gt;unset_userdata('some_name');</code></p>
173
+ <p>This function can also be passed an associative array of items to unset.</p>
174
+ <p><code>$array_items = array('username' => '', 'email' => '');<br />
175
+ <br />
176
+ $this-&gt;session-&gt;unset_userdata(<samp>$array_items</samp>);</code></p>
177
+ <h2>Flashdata</h2>
178
+ <p>CodeIgniter supports &quot;flashdata&quot;, or session data that will only be available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: &quot;record 2 deleted&quot;).</p>
179
+ <p>Note: Flash variables are prefaced with &quot;flash_&quot; so avoid this prefix in your own session names.</p>
180
+ <p>To add flashdata:</p>
181
+ <p><code>$this-&gt;session-&gt;set_flashdata('item', 'value');</code></p>
182
+ <p>You can also pass an array to set_flashdata(), in the same manner as set_userdata(). </p>
183
+ <p>To read a flashdata variable:</p>
184
+ <p><code>$this-&gt;session-&gt;flashdata('item');</code></p>
185
+ <p>If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.</p>
186
+ <p><code>$this-&gt;session-&gt;keep_flashdata('item');</code></p>
187
+ <h2>Saving Session Data to a Database</h2>
188
+ <p>While the session data array stored in the user's cookie contains a Session ID,
189
+ unless you store session data in a database there is no way to validate it. For some applications that require little or no
190
+ security, session ID validation may not be needed, but if your application requires security, validation is mandatory.</p>
191
+
192
+ <p>When session data is available in a database, every time a valid session is found in the user's cookie, a database
193
+ query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never
194
+ be updated, they can only be generated when a new session is created.</p>
195
+
196
+ <p>In order to store sessions, you must first create a database table for this purpose. Here is the basic
197
+ prototype (for MySQL) required by the session class:</p>
198
+
199
+ <textarea class="textarea" style="width:100%" cols="50" rows="8">
200
+ CREATE TABLE IF NOT EXISTS `ci_sessions` (
201
+ session_id varchar(40) DEFAULT '0' NOT NULL,
202
+ ip_address varchar(16) DEFAULT '0' NOT NULL,
203
+ user_agent varchar(50) NOT NULL,
204
+ last_activity int(10) unsigned DEFAULT 0 NOT NULL,
205
+ user_data text NOT NULL,
206
+ PRIMARY KEY (session_id)
207
+ );</textarea>
208
+
209
+ <p><strong>Note:</strong> By default the table is called <dfn>ci_sessions</dfn>, but you can name it anything you want
210
+ as long as you update the <kbd>application/config/config.php</kbd> file so that it contains the name you have chosen.
211
+ Once you have created your database table you can enable the database option in your config.php file as follows:</p>
212
+
213
+ <code>$config['sess_use_database'] = TRUE;</code>
214
+
215
+ <p>Once enabled, the Session class will store session data in the DB.</p>
216
+
217
+ <p>Make sure you've specified the table name in your config file as well:</p>
218
+
219
+ <code>$config['sess_table_name'] = 'ci_sessions";</code>
220
+
221
+ <p class="important"><strong>Note:</strong> The Session class has built-in garbage collection which clears out expired sessions so you
222
+ do not need to write your own routine to do it.</p>
223
+
224
+
225
+ <h2>Destroying a Session </h2>
226
+ <p>To clear the current session: </p>
227
+ <code>$this-&gt;session-&gt;sess_destroy();</code>
228
+ <p class="important"><strong>Note:</strong> This function should be the last one called, and even flash variables will no longer be available. If you only want some items destroyed and not all, use <dfn>unset_userdata()</dfn>.</p>
229
+
230
+
231
+
232
+ <h2>Session Preferences</h2>
233
+ <p>You'll find the following Session related preferences in your <kbd>application/config/config.php</kbd> file:</p>
234
+
235
+
236
+ <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
237
+ <tr>
238
+ <th>Preference</th>
239
+ <th>Default</th>
240
+ <th>Options</th>
241
+ <th>Description</th>
242
+ </tr>
243
+ <tr>
244
+ <td class="td"><strong>sess_cookie_name</strong></td>
245
+ <td class="td">ci_session</td>
246
+ <td class="td">None</td>
247
+ <td class="td">The name you want the session cookie saved as.</td>
248
+ </tr>
249
+ <tr>
250
+ <td class="td"><strong>sess_expiration</strong></td>
251
+ <td class="td">7200</td>
252
+ <td class="td">None</td>
253
+ <td class="td">The number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0</td>
254
+ </tr>
255
+ <tr>
256
+ <td class="td"><strong>sess_encrypt_cookie</strong></td>
257
+ <td class="td">FALSE</td>
258
+ <td class="td">TRUE/FALSE (boolean)</td>
259
+ <td class="td">Whether to encrypt the session data.</td>
260
+ </tr>
261
+ <tr>
262
+ <td class="td"><strong>sess_use_database</strong></td>
263
+ <td class="td">FALSE</td>
264
+ <td class="td">TRUE/FALSE (boolean)</td>
265
+ <td class="td">Whether to save the session data to a database. You must create the table before enabling this option.</td>
266
+ </tr>
267
+ <tr>
268
+ <td class="td"><strong>sess_table_name</strong></td>
269
+ <td class="td">ci_sessions</td>
270
+ <td class="td">Any valid SQL table name</td>
271
+ <td class="td">The name of the session database table.</td>
272
+ </tr>
273
+ <tr>
274
+ <td class="td"><strong>sess_time_to_update</strong></td>
275
+ <td class="td">300</td>
276
+ <td class="td">Time in seconds</td>
277
+ <td class="td">This options controls how often the session class will regenerate itself and create a new session id.</td>
278
+ </tr>
279
+ <tr>
280
+ <td class="td"><strong>sess_match_ip</strong></td>
281
+ <td class="td">FALSE</td>
282
+ <td class="td">TRUE/FALSE (boolean)</td>
283
+ <td class="td">Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically
284
+ changes the IP, so if you want a non-expiring session you will likely set this to FALSE.</td>
285
+ </tr>
286
+ <tr>
287
+ <td class="td"><strong>sess_match_useragent</strong></td>
288
+ <td class="td">TRUE</td>
289
+ <td class="td">TRUE/FALSE (boolean)</td>
290
+ <td class="td">Whether to match the User Agent when reading the session data.</td>
291
+ </tr>
292
+ </table>
293
+
294
+
295
+ </div>
296
+ <!-- END CONTENT -->
297
+
298
+
299
+ <div id="footer">
300
+ <p>
301
+ Previous Topic:&nbsp;&nbsp;<a href="pagination.html">Pagination Class</a>
302
+ &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
303
+ <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
304
+ <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
305
+ Next Topic:&nbsp;&nbsp;<a href="trackback.html">Trackback Class</a>
306
+ </p>
307
+ <p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006-2010 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
308
+ </div>
309
+
310
+ </body>
311
+ </html>
@@ -0,0 +1,292 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>HTML Table Class : CodeIgniter User Guide</title>
7
+
8
+ <style type='text/css' media='all'>@import url('../userguide.css');</style>
9
+ <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
10
+
11
+ <script type="text/javascript" src="../nav/nav.js"></script>
12
+ <script type="text/javascript" src="../nav/prototype.lite.js"></script>
13
+ <script type="text/javascript" src="../nav/moo.fx.js"></script>
14
+ <script type="text/javascript" src="../nav/user_guide_menu.js"></script>
15
+
16
+ <meta http-equiv='expires' content='-1' />
17
+ <meta http-equiv= 'pragma' content='no-cache' />
18
+ <meta name='robots' content='all' />
19
+ <meta name='author' content='ExpressionEngine Dev Team' />
20
+ <meta name='description' content='CodeIgniter User Guide' />
21
+
22
+ </head>
23
+ <body>
24
+
25
+ <!-- START NAVIGATION -->
26
+ <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
27
+ <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
28
+ <div id="masthead">
29
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
30
+ <tr>
31
+ <td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
32
+ <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
33
+ </tr>
34
+ </table>
35
+ </div>
36
+ <!-- END NAVIGATION -->
37
+
38
+
39
+ <!-- START BREADCRUMB -->
40
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
41
+ <tr>
42
+ <td id="breadcrumb">
43
+ <a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
44
+ <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
45
+ HTML Table Class
46
+ </td>
47
+ <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
48
+ </tr>
49
+ </table>
50
+ <!-- END BREADCRUMB -->
51
+
52
+ <br clear="all" />
53
+
54
+
55
+ <!-- START CONTENT -->
56
+ <div id="content">
57
+
58
+
59
+ <h1>HTML Table Class</h1>
60
+
61
+ <p>The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.</p>
62
+
63
+ <h2>Initializing the Class</h2>
64
+
65
+ <p>Like most other classes in CodeIgniter, the Table class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
66
+
67
+ <code>$this->load->library('table');</code>
68
+ <p>Once loaded, the Table library object will be available using: <dfn>$this->table</dfn></p>
69
+
70
+
71
+ <h2>Examples</h2>
72
+
73
+ <p>Here is an example showing how you can create a table from a multi-dimensional array.
74
+ Note that the first array index will become the table heading (or you can set your own headings using the
75
+ <dfn>set_heading()</dfn> function described in the function reference below).</p>
76
+
77
+ <code>
78
+ $this->load->library('table');<br />
79
+ <br />
80
+ $data = array(<br />
81
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Name', 'Color', 'Size'),<br />
82
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Fred', 'Blue', 'Small'),<br />
83
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Mary', 'Red', 'Large'),<br />
84
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'Green', 'Medium') <br />
85
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
86
+ <br />
87
+ echo $this->table->generate($data);
88
+ </code>
89
+
90
+ <p>Here is an example of a table created from a database query result. The table class will automatically generate the
91
+ headings based on the table names (or you can set your own headings using the <dfn>set_heading()</dfn> function described
92
+ in the function reference below).</p>
93
+
94
+ <code>
95
+ $this->load->library('table');<br />
96
+ <br />
97
+ $query = $this->db->query("SELECT * FROM my_table");<br />
98
+ <br />
99
+ echo $this->table->generate($query);
100
+ </code>
101
+
102
+
103
+ <p>Here is an example showing how you might create a table using discrete parameters:</p>
104
+
105
+ <code>
106
+ $this->load->library('table');<br />
107
+ <br />
108
+ $this->table->set_heading('Name', 'Color', 'Size');<br />
109
+ <br />
110
+ $this->table->add_row('Fred', 'Blue', 'Small');<br />
111
+ $this->table->add_row('Mary', 'Red', 'Large');<br />
112
+ $this->table->add_row('John', 'Green', 'Medium');<br />
113
+ <br />
114
+ echo $this->table->generate();
115
+ </code>
116
+
117
+ <p>Here is the same example, except instead of individual parameters, arrays are used:</p>
118
+
119
+ <code>
120
+ $this->load->library('table');<br />
121
+ <br />
122
+ $this->table->set_heading(array('Name', 'Color', 'Size'));<br />
123
+ <br />
124
+ $this->table->add_row(array('Fred', 'Blue', 'Small'));<br />
125
+ $this->table->add_row(array('Mary', 'Red', 'Large'));<br />
126
+ $this->table->add_row(array('John', 'Green', 'Medium'));<br />
127
+ <br />
128
+ echo $this->table->generate();
129
+ </code>
130
+
131
+
132
+ <h2>Changing the Look of Your Table</h2>
133
+
134
+ <p>The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template
135
+ prototype:</p>
136
+
137
+ <code>
138
+ $tmpl = array (<br />
139
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_open'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;table border="0" cellpadding="4" cellspacing="0">',<br />
140
+ <br />
141
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_start'&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
142
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
143
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_start'&nbsp;&nbsp;=> '&lt;th>',<br />
144
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_end'&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/th>',<br />
145
+ <br />
146
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
147
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
148
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
149
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
150
+ <br />
151
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
152
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
153
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
154
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
155
+ <br />
156
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_close'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/table>'<br />
157
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
158
+
159
+ <br />
160
+ $this->table->set_template($tmpl);
161
+ </code>
162
+
163
+ <p class="important"><strong>Note:</strong>&nbsp; You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each
164
+ iteration of the row data.</p>
165
+
166
+ <p>You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements.
167
+ In this example, only the table opening tag is being changed:</p>
168
+
169
+ <code>
170
+ $tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
171
+
172
+ <br />
173
+ $this->table->set_template($tmpl);
174
+ </code>
175
+
176
+ <br />
177
+ <h1>Function Reference</h1>
178
+
179
+ <h2>$this->table->generate()</h2>
180
+ <p>Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.</p>
181
+
182
+ <h2>$this->table->set_caption()</h2>
183
+
184
+ <p>Permits you to add a caption to the table.</p>
185
+
186
+ <code>$this->table->set_caption('Colors');</code>
187
+
188
+ <h2>$this->table->set_heading()</h2>
189
+
190
+ <p>Permits you to set the table heading. You can submit an array or discrete params:</p>
191
+
192
+ <code>$this->table->set_heading('Name', 'Color', 'Size');</code>
193
+ <code>$this->table->set_heading(array('Name', 'Color', 'Size'));</code>
194
+
195
+ <h2>$this->table->add_row()</h2>
196
+
197
+ <p>Permits you to add a row to your table. You can submit an array or discrete params:</p>
198
+
199
+ <code>$this->table->add_row('Blue', 'Red', 'Green');</code>
200
+ <code>$this->table->add_row(array('Blue', 'Red', 'Green'));</code>
201
+
202
+
203
+ <h2>$this->table->make_columns()</h2>
204
+
205
+ <p>This function takes a one-dimensional array as input and creates
206
+ a multi-dimensional array with a depth equal to the number of
207
+ columns desired. This allows a single array with many elements to be
208
+ displayed in a table that has a fixed column count. Consider this example:</p>
209
+
210
+ <code>
211
+ $list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');<br />
212
+ <br />
213
+ $new_list = $this->table->make_columns($list, 3);<br />
214
+ <br />
215
+ $this->table->generate($new_list);<br />
216
+ <br />
217
+ // Generates a table with this prototype<br />
218
+ <br />
219
+ &lt;table border="0" cellpadding="4" cellspacing="0"&gt;<br />
220
+ &lt;tr&gt;<br />
221
+ &lt;td&gt;one&lt;/td&gt;&lt;td&gt;two&lt;/td&gt;&lt;td&gt;three&lt;/td&gt;<br />
222
+ &lt;/tr&gt;&lt;tr&gt;<br />
223
+ &lt;td&gt;four&lt;/td&gt;&lt;td&gt;five&lt;/td&gt;&lt;td&gt;six&lt;/td&gt;<br />
224
+ &lt;/tr&gt;&lt;tr&gt;<br />
225
+ &lt;td&gt;seven&lt;/td&gt;&lt;td&gt;eight&lt;/td&gt;&lt;td&gt;nine&lt;/td&gt;<br />
226
+ &lt;/tr&gt;&lt;tr&gt;<br />
227
+ &lt;td&gt;ten&lt;/td&gt;&lt;td&gt;eleven&lt;/td&gt;&lt;td&gt;twelve&lt;/td&gt;&lt;/tr&gt;<br />
228
+ &lt;/table&gt;</code>
229
+
230
+
231
+
232
+ <h2>$this->table->set_template()</h2>
233
+
234
+ <p>Permits you to set your template. You can submit a full or partial template.</p>
235
+
236
+ <code>
237
+ $tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
238
+
239
+ <br />
240
+ $this->table->set_template($tmpl);
241
+ </code>
242
+
243
+
244
+ <h2>$this->table->set_empty()</h2>
245
+
246
+ <p>Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:</p>
247
+
248
+ <code>
249
+ $this->table->set_empty("&amp;nbsp;");
250
+ </code>
251
+
252
+ <h2>$this->table->clear()</h2>
253
+
254
+ <p>Lets you clear the table heading and row data. If you need to show multiple tables with different data you should
255
+ to call this function after each table has been generated to empty the previous table information. Example:</p>
256
+
257
+ <code>
258
+ $this->load->library('table');<br />
259
+ <br />
260
+ $this->table->set_heading('Name', 'Color', 'Size');<br />
261
+ $this->table->add_row('Fred', 'Blue', 'Small');<br />
262
+ $this->table->add_row('Mary', 'Red', 'Large');<br />
263
+ $this->table->add_row('John', 'Green', 'Medium');<br />
264
+ <br />
265
+ echo $this->table->generate();<br />
266
+ <br />
267
+ <kbd>$this->table->clear();</kbd><br />
268
+ <br />
269
+ $this->table->set_heading('Name', 'Day', 'Delivery');<br />
270
+ $this->table->add_row('Fred', 'Wednesday', 'Express');<br />
271
+ $this->table->add_row('Mary', 'Monday', 'Air');<br />
272
+ $this->table->add_row('John', 'Saturday', 'Overnight');<br />
273
+ <br />
274
+ echo $this->table->generate();
275
+ </code>
276
+
277
+ </div>
278
+ <!-- END CONTENT -->
279
+
280
+
281
+ <div id="footer">
282
+ <p>
283
+ Previous Topic:&nbsp;<a href="ftp.html">&nbsp;FTP Class</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
284
+ <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
285
+ <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
286
+ Next Topic:&nbsp;&nbsp;<a href="image_lib.html">Image Manipulation Class</a>
287
+ </p>
288
+ <p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006-2010 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
289
+ </div>
290
+
291
+ </body>
292
+ </html>