Issues (36)

resources/views/service.tpl.php (1 issue)

Labels
Severity
1
<!DOCTYPE HTML>
2
<!--
3
	Phantom by HTML5 UP
4
	html5up.net | @ajlkn
5
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
6
-->
7
<html>
8
<?php
9
$data = ['title' => 'StupidlySimple PHP | Service'];
10
Core\Viewer::file('layouts/head', $data); ?>
11
<body>
12
<!-- Wrapper -->
13
<div id="wrapper">
14
15
    <?php Viewer::file('layouts/top') ?>
0 ignored issues
show
The type Viewer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
    <?php Viewer::file('layouts/menu') ?>
18
19
    <!-- Main -->
20
    <div id="main">
21
        <div class="inner">
22
            <div class="contents">
23
                <h1>Introduction to Service</h1>
24
                <p>The Service is an important layer in the Model-View-Controller (MVC) based frameworks,
25
                    it is where all of your written applications reside.</p>
26
                <p>A Service Layer defines set of available operations in regards with interfacing client layers i.e.
27
                    encapsulates the application's business logic. Basically, the controller will call the service and
28
                    present something to the client, i.e: a list, a calculated data etc.</p>
29
                <p>Services are defined on <code>/config/services.php</code>. See how we define them <a target="_blank" href="https://github.com/stupidlysimple/framework/blob/master/config/services.php">on GitHub</a>.</p>
30
31
                <h1>Service Demonstration</h1>
32
                <p>We have a couple of test functions to demonstrate how to use service in DSS:</p>
33
34
                <h2>a) A function that only returns a value</h2>
35
                <p>Calling method <b>hello</b> under service <b>test</b>:<br>
36
                    <code>echo $service->test->hello();</code>
37
                </p>
38
                <p>Output:<br>
39
                    <code><?php echo $service->test->hello(); ?></code>
40
                </p>
41
                <p>View on <a target="_blank" href="https://github.com/stupidlysimple/framework/blob/master/app/Service/Test/TestService.php#L8">GitHub</a></p>
42
43
                <h2>b) A function that calculate and returns a value </h2>
44
                <p>Calling method <b>calculate</b> under service <b>test</b> with 3 parameters:<br>
45
                    <code>echo $service->test->calculate(1,'+',2);</code>
46
                </p>
47
                <p>Output:<br>
48
                    <code><?php echo $service->test->calculate(1, '+', 2); ?></code>
49
                </p>
50
            </div>
51
        </div>
52
    </div>
53
54
<?php Viewer::file('layouts/footer') ?>
55
56
</div>
57
58
<?php Viewer::file('layouts/scripts') ?>
59
</body>
60
</html>