Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'vendor/autoload.php';
- use GrapheneNodeClient\Commands\CommandQueryData;
- use GrapheneNodeClient\Commands\DataBase\GetContentCommand;
- use GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector;
- $commandQuery = new CommandQueryData();
- if ($_GET['page'] == true) {
- $data = ['golos-site',$_GET['page']]; // Делаем так, чтобы подгружались данные страницы, содержащей permlink из ?page=
- $commandQuery->setParams($data);
- $connector = new GolosWSConnector();
- $command = new GetContentCommand($connector);
- $res = $command->execute($commandQuery);
- echo '<h1>'.$res['result']['title'].'</h1>'; // Заголовок
- echo $res['result']['body']; // Контент
- } else { // Главная
- $data = ['golos-site','glavnayaglavnaya']; // Делаем так, чтобы подгружались данные главной страницы
- $commandQuery->setParams($data);
- $connector = new GolosWSConnector();
- $command = new GetContentCommand($connector);
- $res = $command->execute($commandQuery);
- echo '<h1>'.$res['result']['title'].'</h1>'; // Заголовок
- echo $res['result']['body']; // Контент
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement