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
Post a Comment