From f1c9c2de5ef40530d1b1a904fa2ee93dc06600a9 Mon Sep 17 00:00:00 2001 From: Brian Daley Date: Wed, 22 Feb 2017 21:26:30 -0500 Subject: [PATCH] Initial commit --- .gitignore | 1 + README.md | 10 ++++++++++ output.php | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 output.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..41a9caa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +class.element.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..43510ae --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Missing Class + +One of your colleagues just committed this super-important file named `output.php` before heading off for vacation. But it looks like they forgot to include the required class, `class.element.php`. It's almost time to release this masterpiece, so you're going to have to write a new one from scratch. + +Use the contents of `output.php` to reverse engineer the missing class, it's attributes and methods. You'll need one of our favorite magic methods, [__toString()](http://php.net/manual/en/language.oop5.magic.php#object.tostring). + +When complete, `output.php` should render the following paragraph in your browser: + + +>Interested in Yahoo? [Click here!](http://yahoo.com/) diff --git a/output.php b/output.php new file mode 100644 index 0000000..f287ee6 --- /dev/null +++ b/output.php @@ -0,0 +1,20 @@ +'http://yahoo.com')); +$link->setAttribute('target', "_blank"); + +/** + * Build our paragraph + */ +$paragraph = new Element('p', "Interested in Yahoo? $link"); + + +/** + * Output the HTML + */ +echo $paragraph;