[MODx] 9. Real Example

Snippet code:

<?php
$path = MODX_CORE_PATH . 'components/storefinder/';
$result = $modx->addPackage('storefinder',$path .
    'model/','modx_');

$result= $modx->getCollection('sfStore');foreach($result as $res){

    $output .= $modx->getChunk('usersChunk', array("store"=>$res->toArray()) );
}

return $output;

 

Chunk Code:

Username: [[+store.name]]<br/>
Active?:  [[+store.city]]<br/>

 

posted @ 2015-01-07 23:48  Zhentiw  阅读(124)  评论(0编辑  收藏  举报