Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 96 | Rev 16768 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
66 efrain 1
<?php
2
declare(strict_types=1);
3
 
4
namespace LeadersLinked\Controller;
5
 
6
use Laminas\Authentication\AuthenticationService;
7
use Laminas\Authentication\Result as AuthResult;
8
use Laminas\Db\Adapter\AdapterInterface;
16766 efrain 9
use LeadersLinked\Cache\CacheInterface;
66 efrain 10
 
11
 
12
use Laminas\Mvc\Controller\AbstractActionController;
13
use Laminas\Mvc\I18n\Translator;
14
use Laminas\Log\LoggerInterface;
15
 
16
use Laminas\View\Model\ViewModel;
17
use Laminas\View\Model\JsonModel;
18
use LeadersLinked\Library\Functions;
19
use LeadersLinked\Mapper\DegreeMapper;
20
use LeadersLinked\Form\DegreeForm;
21
use LeadersLinked\Model\Degree;
22
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
23
 
24
class TestController extends AbstractActionController
25
{
26
    /**
27
     *
28
     * @var AdapterInterface
29
     */
30
    private $adapter;
31
 
32
 
33
    /**
34
     *
16766 efrain 35
     * @var CacheInterface
66 efrain 36
     */
37
    private $cache;
38
 
39
    /**
40
     *
41
     * @var  LoggerInterface
42
     */
43
    private $logger;
44
 
45
    /**
46
     *
47
     * @var array
48
     */
49
    private $config;
50
 
51
 
52
 
53
    /**
54
     *
55
     * @param AdapterInterface $adapter
16766 efrain 56
     *@param CacheInterface $cache
66 efrain 57
     * @param LoggerInterface $logger
58
     * @param array $config
59
     */
60
    public function __construct($adapter, $cache , $logger, $config)
61
    {
62
        $this->adapter      = $adapter;
63
        $this->cache        = $cache;
64
        $this->logger       = $logger;
65
        $this->config       = $config;
66
 
67
 
68
    }
69
 
70
    public function indexAction()
71
    {
72
        $request = $this->getRequest();
73
 
74
        $request = $this->getRequest();
75
        if($request->isGet()) {
76
 
77
            $this->layout()->setTemplate('layout/layout-backend');
78
            $viewModel = new ViewModel();
79
            $viewModel->setTemplate('leaders-linked/test/index.phtml');
80
            return $viewModel ;
81
 
82
 
83
        } else {
84
            return new JsonModel([
85
                'success' => false,
86
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
87
            ]);;
88
        }
89
    }
90
 
91
    public function methodOneAction()
92
    {
95 steven 93
 
66 efrain 94
        $data = [
95
            'success'   => true,
96 steven 96
            'data'   => $_POST
66 efrain 97
        ];
95 steven 98
 
66 efrain 99
        return new JsonModel($data);
100
    }
101
 
102
    public function methodTwoAction()
103
    {
104
        $data = [
105
            'success'   => true,
106
            'data'   => []
107
        ];
108
 
109
        return new JsonModel($data);
110
    }
111
 
112
    public function methodThreeAction()
113
    {
114
        $data = [
115
            'success'   => true,
116
            'data'   => []
117
        ];
118
 
119
        return new JsonModel($data);
120
    }
121
 
122
    public function methodFourAction()
123
    {
124
        $data = [
125
            'success'   => true,
126
            'data'   => []
127
        ];
128
 
129
        return new JsonModel($data);
130
    }
131
 
132
 
133
}