Last active
August 7, 2018 17:40
-
-
Save LucasOliveiraS/dd130f31991d20b3beaa7b7f9fff4372 to your computer and use it in GitHub Desktop.
Embeds on Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include_once 'view.php'; | |
| include_once 'model.php'; | |
| class Controller { | |
| private $url; | |
| public function setUrl($coin) { | |
| $this->url = "https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_INTRADAY&symbol=$coin&market=EUR&apikey=demo"; | |
| return $this->url; | |
| } | |
| public function action() { | |
| $modal = new Model(); | |
| $m = $modal->getJson(); | |
| $update = $m['Meta Data']['7. Last Refreshed']; | |
| $valorBitcoin = $m['Time Series (Digital Currency Intraday)'][$update]['1a. price (EUR)']; | |
| $v = new View($valorBitcoin); | |
| $v->render(); | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment