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,249 @@
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>Calendaring 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
+ Calendaring 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
+
60
+
61
+ <h1>Calendaring Class</h1>
62
+
63
+ <p>The Calendar class enables you to dynamically create calendars. Your calendars can be formatted through the use of a calendar
64
+ template, allowing 100% control over every aspect of its design. In addition, you can pass data to your calendar cells.</p>
65
+
66
+ <h2>Initializing the Class</h2>
67
+
68
+ <p>Like most other classes in CodeIgniter, the Calendar class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
69
+
70
+ <code>$this->load->library('calendar');</code>
71
+ <p>Once loaded, the Calendar object will be available using: <dfn>$this->calendar</dfn></p>
72
+
73
+
74
+ <h2>Displaying a Calendar</h2>
75
+
76
+ <p>Here is a very simple example showing how you can display a calendar:</p>
77
+
78
+ <code>$this->load->library('calendar');<br />
79
+ <br />
80
+ echo $this->calendar->generate();</code>
81
+
82
+ <p>The above code will generate a calendar for the current month/year based on your server time.
83
+ To show a calendar for a specific month and year you will pass this information to the calendar generating function:</p>
84
+
85
+ <code>$this->load->library('calendar');<br />
86
+ <br />
87
+ echo $this->calendar->generate(<kbd>2006</kbd>, <kbd>6</kbd>);</code>
88
+
89
+ <p>The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.</p>
90
+
91
+ <h2>Passing Data to your Calendar Cells</h2>
92
+
93
+ <p>To add data to your calendar cells involves creating an associative array in which the keys correspond to the days
94
+ you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar
95
+ generating function. Consider this example:</p>
96
+
97
+ <code>$this->load->library('calendar');<br />
98
+ <br />
99
+ $data = array(<br />
100
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp; => 'http://example.com/news/article/2006/03/',<br />
101
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp; => 'http://example.com/news/article/2006/07/',<br />
102
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13 => 'http://example.com/news/article/2006/13/',<br />
103
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;26 => 'http://example.com/news/article/2006/26/'<br />
104
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
105
+ <br />
106
+ echo $this->calendar->generate(<kbd>2006</kbd>, <kbd>6</kbd>, <var>$data</var>);</code>
107
+
108
+ <p>Using the above example, day numbers 3, 7, 13, and 26 will become links pointing to the URLs you've provided.</p>
109
+
110
+ <p class="important"><strong>Note:</strong> By default it is assumed that your array will contain links.
111
+ In the section that explains the calendar template below you'll see how you can customize
112
+ how data passed to your cells is handled so you can pass different types of information.</p>
113
+
114
+
115
+ <h2>Setting Display Preferences</h2>
116
+
117
+ <p>There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an
118
+ array of preferences in the second parameter of the loading function. Here is an example:</p>
119
+
120
+
121
+ <code>
122
+ $prefs = array (<br />
123
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'start_day'&nbsp;&nbsp;&nbsp; => 'saturday',<br />
124
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'month_type'&nbsp;&nbsp; => 'long',<br />
125
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'day_type'&nbsp;&nbsp;&nbsp;&nbsp; => 'short'<br />
126
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
127
+ <br />
128
+ $this->load->library('calendar', $prefs);<br />
129
+ <br />
130
+ echo $this->calendar->generate();</code>
131
+
132
+ <p>The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information
133
+ regarding preferences below.</p>
134
+
135
+
136
+
137
+
138
+ <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
139
+ <tr>
140
+ <th>Preference</th>
141
+ <th>Default&nbsp;Value</th>
142
+ <th>Options</th>
143
+ <th>Description</th>
144
+ </tr><tr>
145
+ <td class="td"><strong>template</strong></td><td class="td">None</td><td class="td">None</td><td class="td">A string containing your calendar template. See the template section below.</td>
146
+ </tr><tr>
147
+ <td class="td"><strong>local_time</strong></td><td class="td">time()</td><td class="td">None</td><td class="td">A Unix timestamp corresponding to the current time.</td>
148
+ </tr><tr>
149
+ <td class="td"><strong>start_day</strong></td><td class="td">sunday</td><td class="td">Any week day (sunday, monday, tuesday, etc.)</td><td class="td">Sets the day of the week the calendar should start on.</td>
150
+ </tr><tr>
151
+ <td class="td"><strong>month_type</strong></td><td class="td">long</td><td class="td">long, short</td><td class="td">Determines what version of the month name to use in the header. long = January, short = Jan.</td>
152
+ </tr><tr>
153
+ <td class="td"><strong>day_type</strong></td><td class="td">abr</td><td class="td">long, short, abr</td><td class="td">Determines what version of the weekday names to use in the column headers. long = Sunday, short = Sun, abr = Su.</td>
154
+ </tr><tr>
155
+ <td class="td"><strong>show_next_prev</strong></td><td class="td">FALSE</td><td class="td">TRUE/FALSE (boolean)</td><td class="td">Determines whether to display links allowing you to toggle to next/previous months. See information on this feature below.</td>
156
+ </tr><tr>
157
+ <td class="td"><strong>next_prev_url</strong></td><td class="td">None</td><td class="td">A URL</td><td class="td">Sets the basepath used in the next/previous calendar links.</td>
158
+ </tr>
159
+ </table>
160
+
161
+
162
+
163
+ <h2>Showing Next/Previous Month Links</h2>
164
+
165
+ <p>To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar
166
+ code similar to this example:</p>
167
+
168
+
169
+ <code>$prefs = array (<br />
170
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'show_next_prev'&nbsp;&nbsp;=> TRUE,<br />
171
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'next_prev_url'&nbsp;&nbsp; => 'http://example.com/index.php/calendar/show/'<br />
172
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
173
+ <br />
174
+ $this-&gt;load-&gt;library('calendar', $prefs);<br />
175
+ <br />
176
+ echo $this->calendar->generate(<var>$this->uri->segment(3)</var>, <var>$this->uri->segment(4)</var>);</code>
177
+
178
+ <p>You'll notice a few things about the above example:</p>
179
+
180
+ <ul>
181
+ <li>You must set the "show_next_prev" to TRUE.</li>
182
+ <li>You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.</li>
183
+ <li>You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).</li>
184
+ </ul>
185
+
186
+
187
+
188
+ <h2>Creating a Calendar Template</h2>
189
+
190
+ <p>By creating a calendar template you have 100% control over the design of your calendar. Each component of your
191
+ calendar will be placed within a pair of pseudo-variables as shown here:</p>
192
+
193
+
194
+ <code>
195
+ $prefs['template'] = '<br /><br />
196
+ &nbsp;&nbsp;&nbsp;<dfn>{table_open}</dfn><var>&lt;table border="0" cellpadding="0" cellspacing="0"></var><dfn>{/table_open}</dfn><br />
197
+ <br />
198
+ &nbsp;&nbsp;&nbsp;<dfn>{heading_row_start}</dfn><var>&lt;tr></var><dfn>{/heading_row_start}</dfn><br />
199
+ <br />
200
+ &nbsp;&nbsp;&nbsp;<dfn>{heading_previous_cell}</dfn><var>&lt;th>&lt;a href="</var><kbd>{previous_url}</kbd><var>">&amp;lt;&amp;lt;&lt;/a>&lt;/th></var><dfn>{/heading_previous_cell}</dfn><br />
201
+ &nbsp;&nbsp;&nbsp;<dfn>{heading_title_cell}</dfn><var>&lt;th colspan="</var><kbd>{colspan}</kbd><var>"></var><kbd>{heading}</kbd><var>&lt;/th></var><dfn>{/heading_title_cell}</dfn><br />
202
+ &nbsp;&nbsp;&nbsp;<dfn>{heading_next_cell}</dfn><var>&lt;th>&lt;a href="</var><kbd>{next_url}</kbd><var>">&amp;gt;&amp;gt;&lt;/a>&lt;/th></var><dfn>{/heading_next_cell}</dfn><br />
203
+ <br />
204
+ &nbsp;&nbsp;&nbsp;<dfn>{heading_row_end}</dfn><var>&lt;/tr></var><dfn>{/heading_row_end}</dfn><br />
205
+ <br />
206
+ &nbsp;&nbsp;&nbsp;<dfn>{week_row_start}</dfn><var>&lt;tr></var><dfn>{/week_row_start}</dfn><br />
207
+ &nbsp;&nbsp;&nbsp;<dfn>{week_day_cell}</dfn><var>&lt;td></var><dfn>{week_day}</dfn><var>&lt;/td></var><dfn>{/week_day_cell}</dfn><br />
208
+ &nbsp;&nbsp;&nbsp;<dfn>{week_row_end}</dfn><var>&lt;/tr></var><dfn>{/week_row_end}</dfn><br />
209
+ <br />
210
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_row_start}</dfn><var>&lt;tr></var><dfn>{/cal_row_start}</dfn><br />
211
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_start}</dfn><var>&lt;td></var><dfn>{/cal_cell_start}</dfn><br />
212
+ <br />
213
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_content}</dfn><var>&lt;a href="</var><kbd>{content}</kbd><var>"></var><kbd>{day}</kbd><var>&lt;/a></var><dfn>{/cal_cell_content}</dfn><br />
214
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_content_today}</dfn><var>&lt;div class="highlight">&lt;a href="</var><kbd>{content}</kbd><var>"></var><kbd>{day}</kbd><var>&lt;/a>&lt;/div></var><dfn>{/cal_cell_content_today}</dfn><br />
215
+ <br />
216
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_no_content}</dfn><var></var><kbd>{day}</kbd><var></var><dfn>{/cal_cell_no_content}</dfn><br />
217
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_no_content_today}</dfn><var>&lt;div class="highlight"></var><kbd>{day}</kbd><var>&lt;/div></var><dfn>{/cal_cell_no_content_today}</dfn><br />
218
+ <br />
219
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_blank}</dfn><var>&amp;nbsp;</var><dfn>{/cal_cell_blank}</dfn><br />
220
+ <br />
221
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_cell_end}</dfn><var>&lt;/td></var><dfn>{/cal_cell_end}</dfn><br />
222
+ &nbsp;&nbsp;&nbsp;<dfn>{cal_row_end}</dfn><var>&lt;/tr></var><dfn>{/cal_row_end}</dfn><br />
223
+ <br />
224
+ &nbsp;&nbsp;&nbsp;<dfn>{table_close}</dfn><var>&lt;/table></var><dfn>{/table_close}</dfn><br />
225
+ ';<br />
226
+ <br />
227
+ $this->load->library('calendar', $prefs);<br />
228
+ <br />
229
+ echo $this->calendar->generate();</code>
230
+
231
+
232
+
233
+ </div>
234
+ <!-- END CONTENT -->
235
+
236
+
237
+ <div id="footer">
238
+ <p>
239
+ Previous Topic:&nbsp;&nbsp;<a href="benchmark.html">Benchmark Class</a>
240
+ &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
241
+ <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
242
+ <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
243
+ Next Topic:&nbsp;&nbsp;<a href="cart.html">Cart Class</a>
244
+ </p>
245
+ <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>
246
+ </div>
247
+
248
+ </body>
249
+ </html>
@@ -0,0 +1,346 @@
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>Shopping Cart 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</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
+ Shopping Cart 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>Shopping Cart Class</h1>
60
+
61
+ <p>The Cart Class permits items to be added to a session that stays active while a user is browsing your site.
62
+ These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.</p>
63
+
64
+ <p>Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.</p>
65
+
66
+
67
+ <h2>Initializing the Shopping Cart Class</h2>
68
+
69
+ <p><strong>Important:</strong> The Cart class utilizes CodeIgniter's
70
+ <a href="sessions.html">Session Class</a> to save the cart information to a database, so before using the Cart class you must set up a database table
71
+ as indicated in the <a href="sessions.html">Session Documentation</a> , and set the session preferences in your <kbd>appliction/config/config.php</kbd> file to utilize a database.</p>
72
+
73
+ <p>To initialize the Shopping Cart Class in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p>
74
+
75
+ <code>$this->load->library('cart');</code>
76
+ <p>Once loaded, the Cart object will be available using: <dfn>$this->cart</dfn></p>
77
+
78
+ <p class="important"><strong>Note:</strong> The Cart Class will load and initialize the Session Class automatically, so unless you are using sessions elsewhere in your application, you do not need to load the Session class.</p>
79
+
80
+ <h2>Adding an Item to The Cart</h2>
81
+
82
+ <p>To add an item to the shopping cart, simply pass an array with the product information to the <dfn>$this->cart->insert()</dfn> function, as shown below:</p>
83
+
84
+ <code>
85
+ $data = array(<br />
86
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_123ABC',<br />
87
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
88
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 39.95,<br />
89
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'T-Shirt',<br />
90
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'options' => array('Size' => 'L', 'Color' => 'Red')<br />
91
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
92
+ <br />
93
+
94
+ $this->cart->insert($data);
95
+
96
+ </code>
97
+
98
+ <p class="important"><strong>Important:</strong> The first four array indexes above (<dfn>id</dfn>, <dfn>qty</dfn>, <dfn>price</dfn>, and <dfn>name</dfn>) are <strong>required</strong>.
99
+ If you omit any of them the data will not be saved to the cart. The fifth index (<dfn>options</dfn>) is optional.
100
+ It is intended to be used in cases where your product has options associated with it. Use an array for options, as shown above.</p>
101
+
102
+ <p>The five reserved indexes are:</p>
103
+
104
+ <ul>
105
+ <li><strong>id</strong> - Each product in your store must have a unique identifier. Typically this will be an "sku" or other such identifier.</li>
106
+ <li><strong>qty</strong> - The quantity being purchased.
107
+ <li><strong>price</strong> - The price of the item.
108
+ <li><strong>name</strong> - The name of the item.
109
+ <li><strong>options</strong> - Any additional attributes that are needed to identify the product. These must be passed via an array.
110
+ </ul>
111
+
112
+ <p>In addition to the five indexes above, there are two reserved words: <dfn>rowid</dfn> and <dfn>subtotal</dfn>. These are used internally by the Cart class, so
113
+ please do NOT use those words as index names when inserting data into the cart.</p>
114
+
115
+ <p>Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among
116
+ all your products in order to make displaying the information in a table easier.</p>
117
+
118
+
119
+ <h2>Adding Multiple Items to The Cart</h2>
120
+
121
+ <p>By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow
122
+ people to select from among several items on the same page.</p>
123
+
124
+
125
+ <code>
126
+ $data = array(<br />
127
+
128
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
129
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_123ABC',<br />
130
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
131
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 39.95,<br />
132
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'T-Shirt',<br />
133
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'options' => array('Size' => 'L', 'Color' => 'Red')<br />
134
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
135
+
136
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
137
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_567ZYX',<br />
138
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
139
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 9.95,<br />
140
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'Coffee Mug'<br />
141
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
142
+
143
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
144
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_965QRS',<br />
145
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
146
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 29.95,<br />
147
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'Shot Glass'<br />
148
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
149
+
150
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
151
+ <br />
152
+
153
+ $this->cart->insert($data);
154
+
155
+ </code>
156
+
157
+
158
+
159
+
160
+ <h2>Displaying the Cart</h2>
161
+
162
+ <p>To display the cart you will create a <a href="../general/views.html">view file</a> with code similar to the one shown below.</p>
163
+
164
+ <p>Please note that this example uses the <a href="../helpers/form_helper.html">form helper</a>.</p>
165
+
166
+
167
+ <textarea class="textarea" style="width:100%" cols="50" rows="55">
168
+ &lt;?php echo form_open('path/to/controller/update/function'); ?>
169
+
170
+ &lt;table cellpadding="6" cellspacing="1" style="width:100%" border="0">
171
+
172
+ &lt;tr>
173
+ &lt;th>QTY&lt;/th>
174
+ &lt;th>Item Description&lt;/th>
175
+ &lt;th style="text-align:right">Item Price&lt;/th>
176
+ &lt;th style="text-align:right">Sub-Total&lt;/th>
177
+ &lt;/tr>
178
+
179
+ &lt;?php $i = 1; ?>
180
+
181
+ &lt;?php foreach($this->cart->contents() as $items): ?>
182
+
183
+ &lt;?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
184
+
185
+ &lt;tr>
186
+ &lt;td>&lt;?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?>&lt;/td>
187
+ &lt;td>
188
+ &lt;?php echo $items['name']; ?>
189
+
190
+ &lt;?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>
191
+
192
+ &lt;p>
193
+ &lt;?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?>
194
+
195
+ &lt;strong>&lt;?php echo $option_name; ?>:&lt;/strong> &lt;?php echo $option_value; ?>&lt;br />
196
+
197
+ &lt;?php endforeach; ?>
198
+ &lt;/p>
199
+
200
+ &lt;?php endif; ?>
201
+
202
+ &lt;/td>
203
+ &lt;td style="text-align:right">&lt;?php echo $this->cart->format_number($items['price']); ?>&lt;/td>
204
+ &lt;td style="text-align:right">$&lt;?php echo $this->cart->format_number($items['subtotal']); ?>&lt;/td>
205
+ &lt;/tr>
206
+
207
+ &lt;?php $i++; ?>
208
+
209
+ &lt;?php endforeach; ?>
210
+
211
+ &lt;tr>
212
+ &lt;td colspan="2">&nbsp;&lt;/td>
213
+ &lt;td class="right">&lt;strong>Total&lt;/strong>&lt;/td>
214
+ &lt;td class="right">$&lt;?php echo $this->cart->format_number($this->cart->total()); ?>&lt;/td>
215
+ &lt;/tr>
216
+
217
+ &lt;/table>
218
+
219
+ &lt;p>&lt;?php echo form_submit('', 'Update your Cart'); ?>&lt;/p>
220
+ </textarea>
221
+
222
+
223
+
224
+
225
+ <h2>Updating The Cart</h2>
226
+
227
+ <p>To update the information in your cart, you must pass an array containing the <kbd>Row ID</kbd> and quantity to the <dfn>$this->cart->update()</dfn> function:</p>
228
+
229
+ <p class="important"><strong>Note:</strong> If the quantity is set to zero, the item will be removed from the cart.</p>
230
+
231
+ <code>
232
+ $data = array(<br />
233
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid' => 'b99ccdf16028f015540f341130b6d8ec',<br />
234
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp; => 3<br />
235
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
236
+ <br />
237
+
238
+ $this->cart->update($data);
239
+ <br /><br />
240
+ // Or a multi-dimensional array<br /><br />
241
+ $data = array(<br />
242
+
243
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
244
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'b99ccdf16028f015540f341130b6d8ec',<br />
245
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 3<br />
246
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
247
+
248
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
249
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'xw82g9q3r495893iajdh473990rikw23',<br />
250
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 4<br />
251
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
252
+
253
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
254
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'fh4kdkkkaoe30njgoe92rkdkkobec333',<br />
255
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 2<br />
256
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
257
+
258
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
259
+ <br />
260
+
261
+ $this->cart->update($data);
262
+
263
+
264
+
265
+
266
+ </code>
267
+
268
+ <p><strong>What is a Row ID?</strong>&nbsp; The <kbd>row ID</kbd> is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a
269
+ unique ID is created is so that identical products with different options can be managed by the cart.</p>
270
+
271
+ <p>For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be
272
+ identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this
273
+ difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.</p>
274
+
275
+ <p>In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself
276
+ with the "row ID", other then making sure your "view cart" page contains this information in a hidden form field, and making sure it gets passed to the update
277
+ function when the update form is submitted. Please examine the construction of the "view cart" page above for more information.</p>
278
+
279
+
280
+
281
+ <p>&nbsp;<br /></p>
282
+
283
+
284
+ <h1>Function Reference</h1>
285
+
286
+ <h2>$this->cart->insert();</h2>
287
+
288
+ <p>Permits you to add items to the shopping cart, as outlined above.</p>
289
+
290
+
291
+ <h2>$this->cart->update();</h2>
292
+
293
+ <p>Permits you to update items in the shopping cart, as outlined above.</p>
294
+
295
+
296
+ <h2>$this->cart->total();</h2>
297
+
298
+ <p>Displays the total amount in the cart.</p>
299
+
300
+
301
+ <h2>$this->cart->total_items();</h2>
302
+
303
+ <p>Displays the total number of items in the cart.</p>
304
+
305
+
306
+ <h2>$this->cart->contents();</h2>
307
+
308
+ <p>Returns an array containing everything in the cart.</p>
309
+
310
+
311
+
312
+ <h2>$this->cart->has_options(rowid);</h2>
313
+
314
+ <p>Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with <dfn>$this->cart->contents()</dfn>, since you must pass the <kbd>rowid</kbd> to this function, as shown in the <dfn>Displaying the Cart</dfn> example above.</p>
315
+
316
+
317
+ <h2>$this->cart->options(rowid);</h2>
318
+
319
+ <p>Returns an array of options for a particular product. This function is designed to be used in a loop with <dfn>$this->cart->contents()</dfn>, since you must pass the <kbd>rowid</kbd> to this function, as shown in the <dfn>Displaying the Cart</dfn> example above.</p>
320
+
321
+
322
+
323
+ <h2>$this->cart->destroy();</h2>
324
+
325
+ <p>Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.</p>
326
+
327
+
328
+
329
+
330
+ </div>
331
+ <!-- END CONTENT -->
332
+
333
+
334
+ <div id="footer">
335
+ <p>
336
+ Previous Topic:&nbsp;&nbsp;<a href="calendar.html">Calendar Class</a>
337
+ &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
338
+ <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
339
+ <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
340
+ Next Topic:&nbsp;&nbsp;<a href="config.html">Config Class</a>
341
+ </p>
342
+ <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>
343
+ </div>
344
+
345
+ </body>
346
+ </html>