質問編集履歴

1

コード修正

2020/03/23 02:57

投稿

tada_teratail
tada_teratail

スコア4

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,11 @@
14
14
 
15
15
  ```php
16
16
 
17
+ <?php
18
+
19
+
20
+
17
- require __DIR__ . '/vendor/autoload.php';
21
+ namespace App\Http\Controllers;
18
22
 
19
23
 
20
24
 
@@ -22,13 +26,25 @@
22
26
 
23
27
 
24
28
 
29
+ class TestController extends Controller
30
+
31
+ {
32
+
33
+ public function jasper()
34
+
35
+ {
36
+
25
- $input = __DIR__ . '/vendor/copam/phpjasper/examples/hello_world.jrxml';
37
+ $input = base_path('vendor/copam/phpjasper/examples/hello_world.jrxml');
38
+
39
+ $jasper = new JasperPHP;
40
+
41
+ $jasper->compile($input)->execute();
42
+
43
+ }
44
+
45
+ }
26
46
 
27
47
 
28
-
29
- $jasper = new JasperPHP;
30
-
31
- $jasper->compile($input)->execute();
32
48
 
33
49
  ```
34
50