Welcome Guest, Not a member yet? Register   Sign In
Database driven routes in CodeIgniter with caching
#6

[eluser]boudou[/eluser]
i used your idea with doctrine 1.2 with update events on my routing table


Code:
public function postDelete($event){
        $this->_cache();
    }

      public function postInsert($event){
        $this->_cache();
    }


    function _cache() {

        $data[] = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');";

        $u = Doctrine::getTable('routes')->findAll();
        foreach ($u as $row) {
            $data[] = '$route["' . $row->route . '"] = "' . $row->controller . '";';
        }

        $output = implode("\n", $data);

        write_file(str_replace("\\", "/", FCPATH).APPPATH."cache/routes.php", $output);
    }


Thanks


Messages In This Thread
Database driven routes in CodeIgniter with caching - by El Forum - 05-04-2010, 05:12 PM
Database driven routes in CodeIgniter with caching - by El Forum - 05-31-2010, 03:41 AM
Database driven routes in CodeIgniter with caching - by El Forum - 02-27-2011, 11:25 AM
Database driven routes in CodeIgniter with caching - by El Forum - 02-27-2011, 11:26 AM
Database driven routes in CodeIgniter with caching - by El Forum - 02-27-2011, 11:41 AM
Database driven routes in CodeIgniter with caching - by El Forum - 03-03-2011, 07:25 AM
Database driven routes in CodeIgniter with caching - by El Forum - 08-10-2011, 12:53 PM
Database driven routes in CodeIgniter with caching - by El Forum - 01-31-2013, 03:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB