From 2b4242c230a64e661d1c61da4c9d2c6ea42a2344 Mon Sep 17 00:00:00 2001 From: ericpoe Date: Thu, 1 May 2014 21:53:15 -0500 Subject: [PATCH 1/3] This fixes issue #27 by removing the string concatenation within the echo statements and surrounding the arrays with curly brackets. --- sites/intro-to-php/creating_a_data_class.step | 2 +- sites/intro-to-php/deleting_topics.step | 14 ++++++------ sites/intro-to-php/editing_topics.step | 10 ++++----- sites/intro-to-php/styling_suggestotron.step | 22 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sites/intro-to-php/creating_a_data_class.step b/sites/intro-to-php/creating_a_data_class.step index ca0f83166..09433c43b 100644 --- a/sites/intro-to-php/creating_a_data_class.step +++ b/sites/intro-to-php/creating_a_data_class.step @@ -85,7 +85,7 @@ steps do source_code :php, <<-PHP foreach ($topics as $topic) { - echo "

" .$topic['title']. " (ID: " .$topic['id']. ")

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; echo "

"; echo nl2br($topic['description']); echo "

"; diff --git a/sites/intro-to-php/deleting_topics.step b/sites/intro-to-php/deleting_topics.step index 8f09052a7..a953bd551 100644 --- a/sites/intro-to-php/deleting_topics.step +++ b/sites/intro-to-php/deleting_topics.step @@ -13,14 +13,14 @@ steps do source_code :php, <<-PHP " .$topic['title']. " (ID: " .$topic['id']. ")"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

"; - echo "Edit"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

" + echo "Edit"; echo " | "; - echo "Delete"; + echo "Delete"; echo "

"; } ?> diff --git a/sites/intro-to-php/editing_topics.step b/sites/intro-to-php/editing_topics.step index c694c455a..a41454981 100644 --- a/sites/intro-to-php/editing_topics.step +++ b/sites/intro-to-php/editing_topics.step @@ -13,11 +13,11 @@ steps do source_code :php, <<-PHP " .$topic['title']. " (ID: " .$topic['id']. ")"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

Edit

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

Edit

"; } ?> PHP diff --git a/sites/intro-to-php/styling_suggestotron.step b/sites/intro-to-php/styling_suggestotron.step index 1e38b56c1..5f841f08c 100644 --- a/sites/intro-to-php/styling_suggestotron.step +++ b/sites/intro-to-php/styling_suggestotron.step @@ -27,15 +27,15 @@ steps do " .$topic['title']. " (ID: " .$topic['id']. ")"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

"; - echo "Edit"; - echo " | "; - echo "Delete"; - echo "

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

+ echo "Edit"; + echo " | "; + echo "Delete"; + echo "

"; } ?> @@ -72,9 +72,9 @@ steps do message "For example, by adding a simple class to our Edit and Delete links, we can make them look like buttons:" source_code :php, <<-PHP - echo "Edit"; + echo "Edit"; echo " "; - echo "Delete"; + echo "Delete"; PHP end From ec7bf1c5af23e5763c99197c71e63e2303ceb3bd Mon Sep 17 00:00:00 2001 From: ericpoe Date: Thu, 1 May 2014 22:12:05 -0500 Subject: [PATCH 2/3] Corrected indent whackiness from my previous commit. --- sites/intro-to-php/deleting_topics.step | 8 ++++---- sites/intro-to-php/editing_topics.step | 4 ++-- sites/intro-to-php/styling_suggestotron.step | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sites/intro-to-php/deleting_topics.step b/sites/intro-to-php/deleting_topics.step index a953bd551..7e8233dd3 100644 --- a/sites/intro-to-php/deleting_topics.step +++ b/sites/intro-to-php/deleting_topics.step @@ -13,15 +13,15 @@ steps do source_code :php, <<-PHP {$topic['title']} (ID: {$topic['id']})"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; echo "

"; echo nl2br($topic['description']); echo "

"; echo "

" echo "Edit"; - echo " | "; - echo "Delete"; - echo "

"; + echo " | "; + echo "Delete"; + echo "

"; } ?> PHP diff --git a/sites/intro-to-php/editing_topics.step b/sites/intro-to-php/editing_topics.step index a41454981..4ea3b0b29 100644 --- a/sites/intro-to-php/editing_topics.step +++ b/sites/intro-to-php/editing_topics.step @@ -13,11 +13,11 @@ steps do source_code :php, <<-PHP {$topic['title']} (ID: {$topic['id']})"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; echo "

"; echo nl2br($topic['description']); echo "

"; - echo "

Edit

"; + echo "

Edit

"; } ?> PHP diff --git a/sites/intro-to-php/styling_suggestotron.step b/sites/intro-to-php/styling_suggestotron.step index 5f841f08c..717f5da78 100644 --- a/sites/intro-to-php/styling_suggestotron.step +++ b/sites/intro-to-php/styling_suggestotron.step @@ -27,15 +27,15 @@ steps do {$topic['title']} (ID: {$topic['id']})"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

- echo "Edit"; - echo " | "; - echo "Delete"; - echo "

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

+ echo "Edit"; + echo " | "; + echo "Delete"; + echo "

"; } ?> From d4c3d06a57d889ccbed6548091290ca25107b9fe Mon Sep 17 00:00:00 2001 From: Eric Poe Date: Sun, 4 May 2014 15:53:57 -0500 Subject: [PATCH 3/3] Update indentation from spaces to tabs. --- sites/intro-to-php/deleting_topics.step | 18 +++++++++--------- sites/intro-to-php/editing_topics.step | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sites/intro-to-php/deleting_topics.step b/sites/intro-to-php/deleting_topics.step index 7e8233dd3..21f40ef55 100644 --- a/sites/intro-to-php/deleting_topics.step +++ b/sites/intro-to-php/deleting_topics.step @@ -13,15 +13,15 @@ steps do source_code :php, <<-PHP {$topic['title']} (ID: {$topic['id']})"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

" - echo "Edit"; - echo " | "; - echo "Delete"; - echo "

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

" + echo "Edit"; + echo " | "; + echo "Delete"; + echo "

"; } ?> PHP diff --git a/sites/intro-to-php/editing_topics.step b/sites/intro-to-php/editing_topics.step index 4ea3b0b29..857bdc047 100644 --- a/sites/intro-to-php/editing_topics.step +++ b/sites/intro-to-php/editing_topics.step @@ -13,11 +13,11 @@ steps do source_code :php, <<-PHP {$topic['title']} (ID: {$topic['id']})"; - echo "

"; - echo nl2br($topic['description']); - echo "

"; - echo "

Edit

"; + echo "

{$topic['title']} (ID: {$topic['id']})

"; + echo "

"; + echo nl2br($topic['description']); + echo "

"; + echo "

Edit

"; } ?> PHP