Question about a carbine - Codeigniter library

When I use the carabiner library, my css and js files are added to the top of the page. Is there a way to indicate where the files should be added, maybe try to send the files as an array to my view files?

thank

+3
source share
2 answers

It may be slightly different depending on how you lose your views, but with the usual, dumb way to do it, here is an example:

Home controller:

public function index()
{
  $this->carabiner->css('default.css')
  $this->carabiner->js('custom.js');
  $data['assets'] = $this->carabiner->display_string('both');

  $this->load->view('templates/header', $data);
  $this->load->view('home/index', $data);
  $this->load->view('templates/footer');
}

Type of title:

<html>
<head>
<title>Title of Page</title>
<?php echo $assets; ?>
</head>
...
+3
source

This was one of my main annoyances with Carabiner, an unbuffered outlet. Each output function echoreturns a value, not a return.

( ), , , :

ob_start();
$this->carabiner->display('css');
$css = ob_get_clean();

js/css, . . , , , , , , , .

, Carabiner echo $some_return_value; return $some_return_value; ( ). , .

, - Carabiner ( ). , . !

: http://php.net/manual/en/book.outcontrol.php

+1

All Articles