增加数据首页

This commit is contained in:
Li Jianxuan 2014-02-24 09:03:39 +00:00
parent 777b404191
commit a31b5f8e6a
4 changed files with 41 additions and 45 deletions

View File

@ -13,9 +13,9 @@
<!-- Le styles --> <!-- Le styles -->
<?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico')) <?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'))
// ->prependStylesheet($this->basePath() . '/css/style.css') // ->prependStylesheet($this->basePath() . '/css/style.css')
->prependStylesheet($this->basePath() . '/sjyportal2/css/bootstrap.min.css') ->prependStylesheet($this->basePath() . '/sjyportal/css/bootstrap.min.css')
->prependStylesheet($this->basePath() . '/sjyportal2/css/bootstrap-responsive.min.css') ->prependStylesheet($this->basePath() . '/sjyportal/css/bootstrap-responsive.min.css')
->prependStylesheet($this->basePath() . '/sjyportal2/css/style.css') ->prependStylesheet($this->basePath() . '/sjyportal/css/style.css')
?> ?>
<!-- Scripts --> <!-- Scripts -->

View File

@ -23,49 +23,39 @@ return array(
'router' => array( 'router' => array(
'routes' => array( 'routes' => array(
//通配路由 //数据
'metadata' => array( 'data' => array(
'type' => 'Segment', 'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array( 'options' => array(
'route' => '/metadata[/:controller[/:action[/page/:page][/id/:id]]]', 'route' => '/data',
'constraints' => array( 'defaults' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', 'module' => 'Metadata',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*', '__NAMESPACE__' => 'Metadata\Controller',
'page' => '[a-zA-Z][a-zA-Z0-9_-]*', 'controller' => 'Metadata\Controller\Index',
'id' => '[a-zA-Z][a-zA-Z0-9_-]*', 'action' => 'index',
), ),
'defaults' => array( ),
'module' => 'Article',
'__NAMESPACE__' => 'Article\Controller',
'controller' => 'Article\Controller\Index',
'action' => 'index',
),
),
'may_terminate' => true, 'may_terminate' => true,
'child_routes' => array( 'child_routes' => array(
'wildcard' => array( 'view' => array(
'type' => 'Wildcard' 'type' => 'Segment',
) 'options' => array(
) 'route' => '[/:uuid]',
), 'constraints' => array(
'uuid' => '[a-zA-Z][a-zA-Z0-9_-]*',
//数据 ),
'data' => array( 'defaults' => array(
'type' => 'Segment', 'module' => 'Metadata',
'options' => array( '__NAMESPACE__' => 'Metadata\Controller',
'route' => '/data[/:uuid]', 'controller' => 'Metadata\Controller\Index',
'constraints' => array( 'action' => 'view',
'uuid' => '[a-zA-Z][a-zA-Z0-9_-]*', ),
), ),
'defaults' => array( 'may_terminate' => true,
'module' => 'Metadata', ),
'__NAMESPACE__' => 'Metadata\Controller',
'controller' => 'Metadata\Controller\Index',
'action' => 'index',
),
), ),
'may_terminate' => true ),//data
),
),//routers ),//routers
), ),

View File

@ -42,4 +42,10 @@ class IndexController extends AbstractActionController
return $this->ViewModel; return $this->ViewModel;
} }
public function viewAction()
{
return $this->ViewModel;
}
} }

View File

@ -67,7 +67,7 @@
<?php if(!empty($this->metadata_latest)) { ?> <?php if(!empty($this->metadata_latest)) { ?>
<ul class="unstyled"> <ul class="unstyled">
<?php foreach($this->metadata_latest as $K=>$v) { ?> <?php foreach($this->metadata_latest as $K=>$v) { ?>
<li><img src="<?= $this->basePath("img/westdc_20w.gif") ?>" /><a href="<?= $this->url('data',array('uuid'=>$v['uuid'])) ?>" title="<?= $v['title'] ?>"><?= $v['title'] ?></a></li> <li><img src="<?= $this->basePath("img/westdc_20w.gif") ?>" /><a href="<?= $this->url('data/view',array('uuid'=>$v['uuid'])) ?>" title="<?= $v['title'] ?>"><?= $v['title'] ?></a></li>
<?php } ?> <?php } ?>
</ul> </ul>
<?php } ?> <?php } ?>