Welcome Guest, Not a member yet? Register   Sign In
under maintenance
#3

(This post was last modified: 10-05-2022, 12:33 PM by pippuccio76.)

I found this solution , in view i create a specific view ( under_maintenance.php)  directly under view  . 
In home or other controller create a function:
Code:
public function under_maintenance()
    {
        return view('under_maintenance');

    }

in route
Code:
<?php
namespace Config;

// Create a new instance of our RouteCollection class.
$routes = Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}

//variabile in manutenzione
$under_maintenance = 1;



/*
* --------------------------------------------------------------------
* Router Setup
* --------------------------------------------------------------------
*/
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('User');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();


//route under maintenance
if($under_maintenance){

$routes->get('(:any)', 'Home::under_maintenance');

}else{   

//all other roules
}


there could be problems using this way?
Reply


Messages In This Thread
under maintenance - by pippuccio76 - 09-30-2022, 03:58 AM
RE: under maintenance - by superior - 09-30-2022, 04:15 AM
RE: under maintenance - by pippuccio76 - 10-05-2022, 12:30 PM
RE: under maintenance - by kenjis - 10-05-2022, 03:26 PM
RE: under maintenance - by pippuccio76 - 10-06-2022, 10:21 AM
RE: under maintenance - by kenjis - 10-06-2022, 02:27 PM
RE: under maintenance - by davis.lasis - 10-06-2022, 10:49 PM
RE: under maintenance - by ikesela - 10-06-2022, 11:38 PM
RE: under maintenance - by davis.lasis - 10-07-2022, 01:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB