php - running load_class on mthaml -


i'm trying use load_class load mthaml understood it's necessary performance reasons.

this mthaml library. https://github.com/arnaud-lb/mthaml

it's namespaced everywhere getting working load_class natively hits first hurdle. gets instantiated through autoloader.php does

namespace mthaml;  class autoloader {     static public function register()     {         spl_autoload_register(array(new self, 'autoload'));     }      static public function autoload($class)     {         if (strncmp($class, 'mthaml', 6) !== 0) {             return;         }          if (file_exists($file = __dir__ . '/../' . strtr($class, '\\', '/').'.php')) {             require $file;         }     } 

i'm trying

load_class('autoloader', 'libraries/mthaml', ''); 

but gives me fatal error: class 'autoloader' not found

then if try

load_class('mthaml\autoloader', 'libraries/mthaml', ''); 

i unable locate specified class: mthaml\autoloader.php

right way got working calling so

    require_once __dir__ . '/../libraries/mthaml/autoloader.php';     mthaml\autoloader::register();     $haml = new mthaml\environment('php');     $rendered = $haml->compilefile($haml_file, $haml_cache_path); 

the problem being piece of code ran anytime call $this->load->view in code igniter understood load_class needed optimize performance in 1 controller calling $this->load->view several times.

how use load_class this?

i'm trying use load_class load mthaml understood it's necessary performance reasons.

as far i've unterstood mt-haml not necessary @ all. load_class codeigniter, instead install mt-haml package , include it's autoloader , should fine already.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -