diff --git a/index.php b/index.php index 339305e..ece59c0 100644 --- a/index.php +++ b/index.php @@ -4,4 +4,5 @@ namespace src; require_once "vendor/autoload.php"; -require "views/form.php"; +require "views/post.php"; +//require "views/form.php"; diff --git a/post.php b/post.php new file mode 100644 index 0000000..0274617 --- /dev/null +++ b/post.php @@ -0,0 +1,29 @@ +load($_REQUEST); +$post->save(); + +$post1 = new PostModel(); + +$res = $post1->find(['author' => ['Stas']])->limit(10)->all(); + +$json = new Processing(); +$infArr = $json->createJsonArray($post->labels(), $res, "form2"); + +$table = new \Itguild\Tables\ListJsonTable($infArr); +$table->create(); +$table->render(); \ No newline at end of file diff --git a/post.txt b/post.txt new file mode 100644 index 0000000..d070af1 --- /dev/null +++ b/post.txt @@ -0,0 +1,4 @@ +autoincrement=id;last_id=2;table_name=post +id;author;post +1;Stas;Hello, world!!! +2;Stas;Hello, world!!! diff --git a/src/models/PostModel.php b/src/models/PostModel.php new file mode 100644 index 0000000..232efff --- /dev/null +++ b/src/models/PostModel.php @@ -0,0 +1,31 @@ + 'Автор', + 'post' => 'Пост' + ]; + } +} \ No newline at end of file diff --git a/views/post.php b/views/post.php new file mode 100644 index 0000000..882358c --- /dev/null +++ b/views/post.php @@ -0,0 +1,14 @@ +
\ No newline at end of file