08.10.2017 Views

codeigniter_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CodeIgniter<br />

public function delete_file_cache()<br />

{<br />

$this->output->delete_cache('cachecontroller');<br />

}<br />

}<br />

?><br />

Create a view file called test.php and save it in application/views/test.php<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

CodeIgniter View Example<br />

CodeIgniter View Example<br />

Change the routes.php file in application/config/routes.php to add route for the<br />

above controller and add the following line at the end of the file.<br />

$route['cachecontroller'] = 'Cache_controller';<br />

$route['cachecontroller/delete'] = 'Cache_controller/delete_file_cache';<br />

Type the following URL in the browser to execute the example.<br />

http://yoursite.com/index.php/cachecontroller<br />

After visiting the above URL, you will see that a cache file for this will be created in<br />

application/cache folder. To delete the file, visit the following URL.<br />

http://yoursite.com/index.php/cachecontroller/delete<br />

72

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!