Changeset 1475
- Timestamp:
- 12/09/2007 01:10:07 AM (10 months ago)
- Files:
-
- 1 modified
-
trunk/modules/forge/controllers/forge_demo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/forge/controllers/forge_demo.php
r1474 r1475 41 41 { 42 42 $profiler = new Profiler; 43 $cache = new Cache; 43 44 45 // Cache id for the current empty editing form 46 $cache_id = 'form--'.url::current(); 47 48 if (empty($_POST)) 49 { 50 // Attempt to get the HTML from cache 51 if ($form = $cache->get($cache_id)) 52 { 53 echo $form; 54 return; 55 } 56 } 57 58 // Create a new user editing form 44 59 $form = new User_Edit_Model(NULL, 'Edit User', $id); 45 60 46 61 if ($form->save()) 47 62 { 63 // Cache information is no longer valid 64 $cache->del($cache_id); 65 48 66 echo Kohana::debug('user edited!', $form->as_array()); 67 } 68 69 if (empty($_POST)) 70 { 71 // Cache the form HTML 72 $cache->set($cache_id, $form = $form->html()); 49 73 } 50 74
