의존성 주입
<?xml version="1.0" ?>
<container>
<services>
<service key="Renderer" class="Clover\Framework\Component\Renderer"/>
<service key="Resource" class="Clover\Framework\Component\Resource"/>
<service key="Logger" class="Clover\Classes\Logging\Logger"/>
</services>
</container>
Clover Framework는 의존성 주입을 통하여 기존의 PHP 파일 단위의 기능 개발 형식을 벗어난 효율적인 패턴을 도입하였습니다.
MVC
익숙한 MVC 패턴과 Annotation을 통한 라우트 경로 설정, Middleware 같은 기능을 통하여 편리하게 어플리케이션을 제작하세요.
class IndexController extends BaseController
{
#[Annotation\Middleware('DefaultMiddleware')]
#[Annotation\Route(method: 'GET', pattern: '/')]
public function index()
{
return $this->render('/App/View/index.php');
}
}
CoreJS
CoreJS에는 EventDispatcher를 통한 컴포넌트가 기본적으로 제공됩니다.
AudioRecorder, AudioPlayer, Clipboard, FileService, GamePad, MediaPlayer, Pagination, ScreenService, NotificationService, EventService, WebsocketService, RequestService, MediaSessionService, OpenGL 등등 다양한 기능을 제공합니다.
AudioRecorder, AudioPlayer, Clipboard, FileService, GamePad, MediaPlayer, Pagination, ScreenService, NotificationService, EventService, WebsocketService, RequestService, MediaSessionService, OpenGL 등등 다양한 기능을 제공합니다.
import { MediaPlayer, VisualizerStyle } from "./src/Component/MediaPlayer";
const mediaPlayer = new MediaPlayer();
mediaPlayer.setContext(document.getElementById("player"));
mediaPlayer.setEvents();
mediaPlayer.setVisualizerStyle("circular");
mediaPlayer.setSpectrum(VisualizerStyle.ROTATE_CIRCLE);
const onClickEvent = function () {
mediaPlayer.connectPanEffector();
mediaPlayer.setParseFrequencyTimeout(1000 / 35);
mediaPlayer.play();
};
document.getElementById("play").addEventListener("click", onClickEvent);
const openGL = new OpenGLObject("canvas");
openGL.initialize();
openGL.setClearBufferBit();
const vertexShadow = `
attribute vec3 position;
uniform mat4 matrixShadowMatrix1;
uniform mat4 matrixShadowMatrix2;
void main() {
gl_Position = matrixShadowMatrix1 * matrixShadowMatrix2 * vec4(position, 1.0);
}
`;
const fragmentShadow = `
precision mediump float;
uniform vec3 color;
void main() {
gl_FragColor = vec4(color, 1.0);
}
`;
const compiledVertexShadow = openGL.getVertexShader(vertexShadow);
const compiledFragmentShadow = openGL.getFragmentShader(fragmentShadow);
const program = openGL.createProgram();
openGL.attachShader(program, compiledVertexShadow);
openGL.attachShader(program, compiledFragmentShadow);
openGL.linkProgram(program);
openGL.useProgram(program);
Equalizer 미리보기