From e62dfb1a310aff5efa285e8bde018314e6f70b50 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 2 Aug 2012 12:12:19 +0000 Subject: Application Blog fonctionnelle avec repertoire du framework separé et mod-rewrite utilisé (donc le index.php à la racine ne sert pas, c'est le app/webroot/index.php qui sert) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-php-weave/trunk@9 d972a294-176a-4cf9-8ea1-fcd5b0c30f5c --- .../src/workdir/in/app/View/Posts/add.ctp | 7 +++++ .../src/workdir/in/app/View/Posts/edit.ctp | 8 ++++++ .../src/workdir/in/app/View/Posts/index.ctp | 33 ++++++++++++++++++++++ .../src/workdir/in/app/View/Posts/view.ctp | 6 ++++ 4 files changed, 54 insertions(+) create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp (limited to 'poc/poc02-compiling-cake/src/workdir/in/app/View/Posts') diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp new file mode 100644 index 0000000..c36d35e --- /dev/null +++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp @@ -0,0 +1,7 @@ +

Add Post

+Form->create('Post'); +echo $this->Form->input('title'); +echo $this->Form->input('body', array('rows' => '3')); +echo $this->Form->end('Save Post'); +?> diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp new file mode 100644 index 0000000..221d85a --- /dev/null +++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp @@ -0,0 +1,8 @@ +

Edit Post

+Form->create('Post', array('action' => 'edit')); + echo $this->Form->input('title'); + echo $this->Form->input('body', array('rows' => '3')); + echo $this->Form->input('id', array('type' => 'hidden')); + echo $this->Form->end('Save Post'); +?> diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp new file mode 100644 index 0000000..754b378 --- /dev/null +++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp @@ -0,0 +1,33 @@ +

Blog posts

+

Html->link('Add Post', array('action' => 'add')); ?>

+ + + + + + + + + + + + + + + + + + + +
IdTitleActionsCreated
+ Html->link($post['Post']['title'], array('action' => 'view', $post['Post']['id'])); ?> + + Form->postLink( + 'Delete', + array('action' => 'delete', $post['Post']['id']), + array('confirm' => 'Are you sure?')); + ?> + Html->link('Edit', array('action' => 'edit', $post['Post']['id'])); ?> + + +
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp new file mode 100644 index 0000000..4fb6556 --- /dev/null +++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp @@ -0,0 +1,6 @@ +

+ +

Created:

+ +

+ -- cgit v1.2.3