File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
namespace app ;
3
3
4
- class App
4
+ require __DIR__ . '/../vendor/liw/core/App.php ' ;
5
+
6
+ use liw \core \App as Application ;
7
+
8
+ /**
9
+ * Class App
10
+ * @package app
11
+ */
12
+ class App extends Application
5
13
{
6
14
public function __construct ()
7
15
{
8
- echo 'Создался новый экземпляр класса из папки "app/" ' ;
16
+ // Обращаемся к конструктору родительского класса
17
+ parent ::__construct ();
18
+ echo 'Создался новый экземпляр класса из папки "app/"<br> ' ;
9
19
}
10
20
}
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ class App
8
8
{
9
9
public function __construct ()
10
10
{
11
- echo 'Создался новый экземпляр класса из папки "vendor/liw/core/" ' ;
11
+ echo 'Создался новый экземпляр класса из папки "vendor/liw/core/"<br> ' ;
12
12
}
13
13
}
Original file line number Diff line number Diff line change 4
4
* На этот файл будут переадресованы все запросы нашего сайта.
5
5
*/
6
6
7
- // Подключили файл из папки vendor
8
- require __DIR__ . '/../vendor/liw/core/App.php ' ;
9
-
10
- // создали новый объект класса из папки vendor
11
- $ app = new liw \core \App ();
12
-
13
-
14
- echo '<br> ' ;
15
-
16
-
17
7
// Подключили файл из папки app
18
8
require __DIR__ . '/../app/App.php ' ;
19
9
You can’t perform that action at this time.
0 commit comments