Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Σταύρος Παπαδάκης
gredu_labs
Commits
ff5671f4
Commit
ff5671f4
authored
Feb 10, 2016
by
Georgios Tsakalos
Browse files
add services to school container
parent
66a3e32b
Changes
1
Hide whitespace changes
Inline
Side-by-side
module/schools/bootstrap.php
View file @
ff5671f4
...
...
@@ -15,21 +15,46 @@ return function (Slim\App $app) {
$container
[
'autoloader'
]
->
addPsr4
(
'GrEduLabs\\Schools\\'
,
__DIR__
.
'/src/'
);
$container
[
GrEduLabs\Schools\Action\Index
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Index
(
$c
->
get
(
'view'
));
return
new
GrEduLabs\Schools\Action\Index
(
$c
->
get
(
'view'
),
$c
->
get
(
'schoolservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\Staff
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Staff
(
$c
->
get
(
'view'
));
return
new
GrEduLabs\Schools\Action\Staff
(
$c
->
get
(
'view'
),
$c
->
get
(
'staffservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\StaffCreate
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\StaffCreate
(
$c
->
get
(
'staffservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\Labs
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Labs
(
$c
->
get
(
'view'
));
return
new
GrEduLabs\Schools\Action\Labs
(
$c
->
get
(
'view'
)
);
};
$container
[
GrEduLabs\Schools\Action\Assets
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Assets
(
$c
->
get
(
'view'
));
};
$container
[
'schoolservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\SchoolService
();
};
$container
[
'staffservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\StaffService
(
$c
->
get
(
'schoolservice'
)
);
};
$events
=
$container
[
'events'
];
$events
(
'on'
,
'bootstrap'
,
function
()
use
(
$container
)
{
...
...
@@ -41,5 +66,6 @@ return function (Slim\App $app) {
$this
->
get
(
'/staff'
,
GrEduLabs\Schools\Action\Staff
::
class
)
->
setName
(
'school.staff'
);
$this
->
get
(
'/labs'
,
GrEduLabs\Schools\Action\Labs
::
class
)
->
setName
(
'school.labs'
);
$this
->
get
(
'/assets'
,
GrEduLabs\Schools\Action\Assets
::
class
)
->
setName
(
'school.assets'
);
$this
->
post
(
'/staff'
,
GrEduLabs\Schools\Action\StaffCreate
::
class
)
->
setName
(
'school.staffcreate'
);
});
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment