<?php

ini_set('memory_limit', '1024M');

?>


Tags : php,  


  Step 1 : Go to app/config/  directory



  Step 2 : Make your setting file



   File Name : settings.php
  
   code :
  


   <?php
    
     $config['Settings'] = array('id'=>'1','name'=>'Pathlogy'); 
  
   ?>




Step 3 : Open your Bootstrap file from app/config/  directory 


  Load your setting file into Bootstrap.

 


  <?php
 
      Configure::load('settings'); 
 
  ?>


 
 
 
Step 4 : Go to your example controller

 


 
<?php
 
class ExampleController extends AppController
{
 
      function index()
    {   
        $module_id = Configure::read('Setting.id');
        $module_name = Configure::read('Setting.name');
       
        debug($module_id);
        debug($module_name);   
   
    }
}   
 
 
?>

 


 




DOM PDF INTEGRATION IN CAKEPHP

Step 1 : Download Dompdf lib from dompdf site,

Step 2 : Dompdf lib put into cakephp app/vendors directory

Step 3 : Create your function into your controller for run dompdf.

 

 

<?php

 

function example()

{

 

App::import(‘Vendor’, ‘dompdf’, array(‘file’ => ‘dompdf’ . DS . ‘dompdf_config.inc.php’));

$html =
‘<html><body>’.
‘<p>Put your html here, or generate it with your favourite ‘.
‘templating system.</p>’.
‘</body></html>’;

$this->dompdf = new DOMPDF();
$papersize = “legal”;
$orientation = ‘landscape’;
$this->dompdf->load_html($html);
$this->dompdf->set_paper($papersize, $orientation);
$this->dompdf->render();

$output = $this->dompdf->output();
file_put_contents(‘Brochure.pdf’, $output);

 

}

 

?>