Welcome Guest, Not a member yet? Register   Sign In
Merge .js files to load only "single merged maxi one"
#3

(12-15-2017, 10:52 AM)Wouter60 Wrote: You can use 2 differente templates. One for the development environment, and one for production.
E.g.:

template_dev.php:
PHP Code:
$this->load->view('template/header_dev');
$this->load->view($main_view);
$this->load->view('template/footer_dev'); 

template_prod.php:
PHP Code:
$this->load->view('template/header_prod');
$this->load->view($main_view);
$this->load->view('template/footer_prod'); 

In your controller, you do this:
PHP Code:
$data['main_view'] = 'the_view';
if (
ENVIRONMENT == 'production') {
 
  $this->load->view('template/template_prod',$data);
}
else {
 
  $this->load->view('template/template_dev',$data);


The header_prod.php file must load the merged js file. The header_dev.php file must load the js files separately.

Yes, thanks... but my issue is "how to auto-merge these files?". As I said, there are several enterprise platoform that do this kind of task beyond load different files
Reply


Messages In This Thread
RE: Merge .js files to load only "single merged maxi one" - by ldetomi - 12-18-2017, 12:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB