hmvc - FuelPHP - Building a page in blocks -


what best way build page in fuelphp each of blocks of page built on own modules , output html put in layout.

the best have found far hmvc below.

$block1= request::forge('mycontroller/block1')->execute(); $block2= request::forge('mycontroller/block2')->execute();  $data['block1'] =$block1; $data['block2'] = $block2;  //assign view browser output return view::forge('home/index', $data); 

however loading whole framework calls seems rather inefficient (and possibly slow result) . there better way this?

if you're using modules (instead of calling different action in same controller seem here), requests absolutely way go. , since requests use routing table, can control controller/action called manipulating routes.

setting new request isn't complex, additional delay few milliseconds tops.

for completeness, way perform hmvc request:

try {     $result = \request::forge('your/uri/here')->execute()->response()->body; } catch (\httpnotfoundexception $e) {     // requested uri not found } 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -