Skip to content

Commit

Permalink
added base styling
Browse files Browse the repository at this point in the history
  • Loading branch information
beezee committed Apr 7, 2012
1 parent d74c434 commit c47efc5
Show file tree
Hide file tree
Showing 21 changed files with 3,445 additions and 14 deletions.
2 changes: 2 additions & 0 deletions bootstrap.php
Expand Up @@ -12,6 +12,8 @@

$app->baseurl = $baseurl;

$app->app_name = $appname;

R::setup("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpw);

//discover and register models
Expand Down
2 changes: 1 addition & 1 deletion config.php
@@ -1,6 +1,6 @@
<?php

$dbhost = 'localhost';
$dbhost = 'localhost';
$dbname = '';
$dbuser = '';
$dbpw = '';
Expand Down
7 changes: 3 additions & 4 deletions lib/baseModel.php
Expand Up @@ -109,16 +109,15 @@ public function renderItem($id)
$props = '';
foreach($this->properties as $prop => $val)
{
$props .= $tpl->copy('property')->replace('propName', $prop)->replace('propVal', $model->$prop);
$props .= $tpl->copy('property')->replace('propname', $prop)->replace('propval', $model->$prop);
}
return $output
->replace('new_link', '')
->replace('id', $model->id)
->replace('property', '')
->replace('propVal', $model->{$this->toString})
->replace('property', $props)
->replace('propval', $model->{$this->toString})
->replace('plural', $this->plural)
->replace('toString', $model->{$this->toString})
->replace('property', $props)
->replace('base_url', $this->app->baseurl);
}
}
9 changes: 9 additions & 0 deletions lib/mpMVC.php
Expand Up @@ -39,4 +39,13 @@ public function setRoutes(array $routes)
{
$this->routes = array_merge($this->routes, $routes);
}

public function render($content)
{
$output = new Stamp(Stamp::load(dirname(__FILE__).'/../views/appLayout.tpl'));
return $output
->replace('app_name', $this->app_name)
->replace('base_url', $this->baseurl)
->replace('yield', $content);
}
}
11 changes: 6 additions & 5 deletions lib/router.php
Expand Up @@ -24,15 +24,16 @@ class mpMVCRouter

public function home()
{
echo 'Welcome to mpMVC';
$app = F3::get('app');
echo $app->render('Welcome to mpMVC');
}

public function modelAdd()
{
$app = F3::get('app');
$model = $app->model(F3::get('PARAMS["model"]'), 'single');
if (!$model->scaffold()) F3::error(404);
echo $model->renderToForm('add');
echo $app->render($model->renderToForm('add'));
}

public function modelCreate()
Expand All @@ -56,7 +57,7 @@ public function modelEdit()
$model = $app->model(F3::get('PARAMS["model"]'), 'plural');
if (!$model->scaffold()) F3::error(404);
$instance = $model->load($id);
echo $model->renderToForm('edit', $instance);
echo $app->render($model->renderToForm('edit', $instance));
}

public function modelUpdate()
Expand All @@ -80,15 +81,15 @@ public function modelView()
$model = $app->model(F3::get('PARAMS["model"]'), 'plural');
$id = F3::get('PARAMS["id"]');
if (!$model->scaffold()) F3::error(404);
echo $model->renderItem($id);
echo $app->render($model->renderItem($id));
}

public function modelList()
{
$app = F3::get('app');
$model = $app->model(F3::get('PARAMS["model"]'), 'plural');
if (!$model->scaffold()) F3::error(404);
echo $model->renderList();
echo $app->render($model->renderList());
}
}

Expand Down
47 changes: 47 additions & 0 deletions public/404.html
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>

<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Your Page Title Here :)</title>
<meta name="description" content="">
<meta name="author" content="">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<!-- CSS
================================================== -->
<link rel="stylesheet" href="stylesheets/base.css">
<link rel="stylesheet" href="stylesheets/skeleton.css">
<link rel="stylesheet" href="stylesheets/layout.css">

<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

</head>
<body>

<!-- Primary Page Layout
================================================== -->
<div class="container">
<h1 style="margin-top: 100px; text-align:center">Sorry. Couldn't Find That Page!</h1>
</div>

<!-- End Document
================================================== -->
</body>
</html>
Binary file added public/images/apple-touch-icon-114x114.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apple-touch-icon-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon.ico
Binary file not shown.

0 comments on commit c47efc5

Please sign in to comment.