Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7cdbd05

Browse files
Make it able to work with sub folders of controllers
1 parent b7f7274 commit 7cdbd05

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

‎src/controllers/Folder1/Class1.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace Controllers\Module1;
3+
4+
use \Controllers\Controller;
5+
6+
/**
7+
* ModuleClass file
8+
* For example for large projects with many folders (modules)
9+
*/
10+
class Class1 extends Controller
11+
{
12+
public function index()
13+
{
14+
echo 'This is ' . __CLASS__;
15+
}
16+
}

‎src/controllers/Folder1/Class2.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace Controllers\Module1;
3+
4+
use \Controllers\Controller;
5+
6+
/**
7+
* ModuleClass file
8+
* For example for large projects with many folders (modules)
9+
*/
10+
class Class2 extends Controller
11+
{
12+
public function index($data)
13+
{
14+
echo 'This is ' . __CLASS__ . '<br>';
15+
var_dump($data);
16+
}
17+
}

‎src/controllers/Folder2/Class1.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace Controllers\Module2;
3+
4+
use \Controllers\Controller;
5+
6+
/**
7+
* ModuleClass file
8+
* For example for large projects with many folders (modules)
9+
*/
10+
class Class1 extends Controller
11+
{
12+
public function index()
13+
{
14+
echo 'This is ' . __CLASS__;
15+
}
16+
}

‎src/controllers/Folder2/Class2.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace Controllers\Module2;
3+
4+
use \Controllers\Controller;
5+
6+
/**
7+
* ModuleClass file
8+
* For example for large projects with many folders (modules)
9+
*/
10+
class Class2 extends Controller
11+
{
12+
public function index($data)
13+
{
14+
echo 'This is ' . __CLASS__ . '<br>';
15+
var_dump($data);
16+
}
17+
}

‎src/views/Index/about.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>About</title>
8+
</head>
9+
<body>
10+
<h1>About Us</h1>
11+
<p>Detailed info goes here</p>
12+
</body>
13+
</html>

‎src/views/Index/home.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Homepage</title>
8+
</head>
9+
<body>
10+
<h1>Main page</h1>
11+
<p>This is the homepage</p>
12+
</body>
13+
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /