Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop'

Conflicts:
	config/application.config.php
	config/autoload/global.php
	module/Application/Module.php
	module/Application/config/module.config.php
	module/Application/view/layout/layout.phtml
  • Loading branch information...
commit 11feda107f7d026e85f8465963ca0f6a176110a2 2 parents e45f6e5 + 9ced96e
@wzlibra authored
View
3  .gitignore
@@ -0,0 +1,3 @@
+/.settings
+/.project
+/.buildpath
View
27 config/application.config.php
@@ -1,15 +1,16 @@
<?php
-return array(
- 'modules' => array(
- 'Application',
- ),
- 'module_listener_options' => array(
- 'config_glob_paths' => array(
- 'config/autoload/{,*.}{global,local}.php',
- ),
- 'module_paths' => array(
- './module',
- './vendor',
- ),
- ),
+return array(
+ 'modules' => array(
+ 'Application',
+ 'Stock',
+ ),
+ 'module_listener_options' => array(
+ 'config_glob_paths' => array(
+ 'config/autoload/{,*.}{global,local}.php',
+ ),
+ 'module_paths' => array(
+ './module',
+ './vendor',
+ ),
+ ),
);
View
17 config/autoload/global.php
@@ -11,6 +11,19 @@
* file.
*/
-return array(
- // ...
+return array(
+ 'navigation' => array(
+ 'default' => array(
+ array(
+ 'label' => 'Home',
+ 'route' => 'home',
+ ),
+ array(
+ 'label' => 'Stock',
+ 'route' => 'stock',
+ ),
+ )
+ ),
+
+ // ...
);
View
2  module/Application/Module.php
@@ -30,7 +30,7 @@ public function getConfig()
public function getAutoloaderConfig()
{
return array(
- 'Zend\Loader\StandardAutoloader' => array(
+ 'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
View
11 module/Application/config/module.config.php
@@ -19,11 +19,7 @@
'action' => 'index',
),
),
- ),
- // The following is a route to simplify getting started creating
- // new controllers and actions without needing to create a new
- // module. Simply drop new controllers in, and you can access them
- // using the path /application/:controller/:action
+ ),
'application' => array(
'type' => 'Literal',
'options' => array(
@@ -55,10 +51,11 @@
'service_manager' => array(
'factories' => array(
'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
+ 'default' => 'Zend\Navigation\Service\DefaultNavigationFactory',
),
),
'translator' => array(
- 'locale' => 'en_US',
+ 'locale' => 'zh_CN',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
@@ -85,7 +82,7 @@
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
- __DIR__ . '/../view',
+ 'application' => __DIR__ . '/../view',
),
),
);
View
90 module/Application/view/layout/layout.phtml
@@ -1,49 +1,57 @@
<?php echo $this->doctype(); ?>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <?php echo $this->headTitle('ZF2 '. $this->translate('Skeleton Application'))->setSeparator(' - ')->setAutoEscape(false) ?>
+<html lang="cn">
+<head>
+<meta charset="utf-8">
+<?php echo $this->headTitle($this->translate('invest').$this->translate('Skeleton Application'))->setSeparator(' - ')->setAutoEscape(false) ?>
- <?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') ?>
+<?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') ?>
- <!-- Le styles -->
- <?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/images/favicon.ico'))
- ->prependStylesheet($this->basePath() . '/css/bootstrap-responsive.min.css')
- ->prependStylesheet($this->basePath() . '/css/style.css')
- ->prependStylesheet($this->basePath() . '/css/bootstrap.min.css') ?>
+<!-- Le styles -->
+<?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/images/favicon.ico'))
+->prependStylesheet($this->basePath() . '/css/bootstrap-responsive.min.css')
+->prependStylesheet($this->basePath() . '/css/style.css')
+->prependStylesheet($this->basePath() . '/css/bootstrap.min.css')
+?>
- <!-- Scripts -->
- <?php echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',))
- ->prependFile($this->basePath() . '/js/bootstrap.min.js')
+<!-- Scripts -->
+<?php echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',))
+->prependFile($this->basePath() . '/js/bootstrap.min.js')
->prependFile($this->basePath() . '/js/jquery.min.js') ?>
- </head>
- <body>
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Skeleton Application') ?></a>
- <div class="nav-collapse collapse">
- <ul class="nav">
- <li class="active"><a href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Home') ?></a></li>
- </ul>
- </div><!--/.nav-collapse -->
- </div>
- </div>
- </div>
- <div class="container">
- <?php echo $this->content; ?>
- <hr>
- <footer>
- <p>&copy; 2005 - 2012 by Zend Technologies Ltd. <?php echo $this->translate('All rights reserved.') ?></p>
- </footer>
- </div> <!-- /container -->
- <?php echo $this->inlineScript() ?>
- </body>
+</head>
+<body>
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="btn btn-navbar" data-toggle="collapse"
+ data-target=".nav-collapse"> <span class="icon-bar"></span> <span
+ class="icon-bar"></span> <span class="icon-bar"></span>
+ </a> <a class="brand" href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Skeleton Application') ?>
+ </a>
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ <li class="active"><a href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Home') ?>
+ </a></li>
+ <li class="active"><a href="<?php echo $this->url('stock') ?>">Stock</a>
+ </li>
+ </ul>
+ </div>
+ <!--/.nav-collapse -->
+ </div>
+ </div>
+ </div>
+ <div class="container">
+ <?php echo $this->content; ?>
+ <hr>
+ <footer>
+ <p>
+ &copy; 2005 - 2012 by Zend Technologies Ltd.
+ <?php echo $this->translate('All rights reserved.') ?>
+ </p>
+ </footer>
+ </div>
+ <!-- /container -->
+ <?php echo $this->inlineScript() ?>
+</body>
</html>
View
21 module/Stock/Module.php
@@ -0,0 +1,21 @@
+<?php
+namespace Stock;
+
+class Module {
+ public function getAutoloaderConfig() {
+ return array(
+ 'Zend\Loader\ClassMapAutoloader' => array(
+ __DIR__.'/autoload_classmap.php',
+ ),
+ 'Zend\Loader\StandardAutoloader' => array(
+ 'namespaces' => array(
+ __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,
+ ),
+ ),
+ );
+ }
+
+ public function getConfig() {
+ return include __DIR__ . '/config/module.config.php';
+ }
+}
View
4 module/Stock/autoload_classmap.php
@@ -0,0 +1,4 @@
+<?php
+return array(
+
+);
View
35 module/Stock/config/autoload/global.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Global Configuration Override
+ *
+ * You can use this file for overriding configuration values from modules, etc.
+ * You would place values in here that are agnostic to the environment and not
+ * sensitive to security.
+ *
+ * @NOTE: In practice, this file will typically be INCLUDED in your source
+ * control, so do not include passwords or other sensitive information in this
+ * file.
+ */
+
+return array(
+ 'navigation' => array(
+ 'default' => array(
+ array(
+ 'label' => 'Home',
+ 'route' => 'home',
+ ),
+ array(
+ 'label' => 'Stock',
+ 'route' => 'stock',
+ 'pages' => array(
+ array(
+ 'label' => 'add',
+ 'route' => 'stock\add'
+ ),
+ ),
+ ),
+ )
+ ),
+
+ // ...
+);
View
33 module/Stock/config/module.config.php
@@ -0,0 +1,33 @@
+<?php
+return array(
+ 'controllers' => array(
+ 'invokables' => array(
+ 'Stock\Controller\Stock' => 'Stock\Controller\StockController',
+ ),
+ ),
+
+ 'router' => array(
+ 'routes' => array(
+ 'stock' => array(
+ 'type' => 'segment',
+ 'options' => array(
+ 'route' => '/stock[/:action][/:id]',
+ 'constraints' => array(
+ 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
+ 'id' => '[0-9]+',
+ ),
+ 'defaults' => array(
+ 'controller' => 'Stock\Controller\Stock',
+ 'action' => 'index',
+ ),
+ ),
+ ),
+ ),
+ ),
+
+ 'view_manager' => array(
+ 'template_path_stack' => array(
+ 'stock' => __DIR__.'/../view',
+ ),
+ ),
+);
View
24 module/Stock/src/Stock/Controller/StockController.php
@@ -0,0 +1,24 @@
+<?php
+namespace Stock\Controller;
+
+use Zend\View\Model\ViewModel;
+
+use Zend\Mvc\Controller\AbstractActionController;
+
+class StockController extends AbstractActionController {
+ public function indexAction() {
+ $vm = new ViewModel();
+ $vm->setTemplate("stock/stock/index");
+
+ return $vm;
+ }
+ public function addAction() {
+ //return new ViewModel();
+ }
+ public function editAction() {
+ //return new ViewModel();
+ }
+ public function deleteAction() {
+ //return new ViewModel();
+ }
+}
View
6 module/Stock/src/Stock/Model/Stock.php
@@ -0,0 +1,6 @@
+<?php
+class Stock {
+ public $id;
+ public $name;
+ public $encode;
+}
View
23 module/Stock/src/Stock/Model/StockTable.php
@@ -0,0 +1,23 @@
+<?php
+namespace Stock\Model;
+
+use Zend\Db\TableGateway\TableGateway;
+
+class StockTable {
+
+ protected $tableGateway;
+
+ public function __construct(TableGateway $tableGateway) {
+ $this->tableGateway = $tableGateway;
+ }
+
+ public function fetchAll() {
+ $resultSet = $this->tableGateway->select();
+ return $resultSet;
+ }
+
+ public function getStock() {
+ $id = (int)$id;
+
+ }
+}
View
1  module/Stock/view/stock/stock/add.phtml
@@ -0,0 +1 @@
+stock add
View
1  module/Stock/view/stock/stock/delete.phtml
@@ -0,0 +1 @@
+<div>stock delete</div>
View
1  module/Stock/view/stock/stock/edit.phtml
@@ -0,0 +1 @@
+<div>stock edit</div>
View
1  module/Stock/view/stock/stock/index.phtml
@@ -0,0 +1 @@
+<div class="row content">StockIndex</div>
Please sign in to comment.
Something went wrong with that request. Please try again.