增加数据首页

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 -->
<?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() . '/sjyportal2/css/bootstrap.min.css')
->prependStylesheet($this->basePath() . '/sjyportal2/css/bootstrap-responsive.min.css')
->prependStylesheet($this->basePath() . '/sjyportal2/css/style.css')
->prependStylesheet($this->basePath() . '/sjyportal/css/bootstrap.min.css')
->prependStylesheet($this->basePath() . '/sjyportal/css/bootstrap-responsive.min.css')
->prependStylesheet($this->basePath() . '/sjyportal/css/style.css')
?>
<!-- Scripts -->

View File

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

View File

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

View File

@ -67,7 +67,7 @@
<?php if(!empty($this->metadata_latest)) { ?>
<ul class="unstyled">
<?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 } ?>
</ul>
<?php } ?>