Smarty
Smarty��PHP�̃e���v���[�g�G���W���ł��B
PHP4.0.6�ȍ~�œ��삵�܂��B
Smarty���{(�b��)�����T�C�g
Smarty�����T�C�g
Smarty���{�����T�C�g
�_�E�����[�h�p�b�P�[�W���𓀂���ƁAlibs �Ƃ����f�B���N�g��������A���ꂪSmarty�̃\�[�X�����ۂɓ����Ă���R�[�h�ł��B
Smarty.class.php ��ǂݍ���Ŏg���܂��B
<?php
require'Smarty/libs/smarty.class.php';
function get_smarty_object(){
$smarty = new Smarty();
// �e���v���[�g�t�@�C�������݂���f�B���N�g��
$smarty->template_dir = "./template/";
// �e���v���[�g�̃L���b�V�����쐬����f�B���N�g��
$smarty->compile_dir = "./compile/";
return $smarty;
}
$smarty = get_smarty_object();
?>
�ŁA���̂悤�Ɋ����g���� $smarty �I�u�W�F�N�g�����܂��B
�I�u�W�F�N�g�w�����D���ȕ��͈ȉ��̂悤�Ȋ����� Smarty �̃T�u�N���X������Ă��悢�ł��傤�B
<?php
class customSmarty extends Smarty {
function customSmarty() {
$this->Smarty();
$this->template_dir = "";
$this->compile_dir = "";
}
}
$smarty = new customSmarty();
?>
��template_dir �Ƃ��Ďw�肵�Ă���̂́A�e���v���[�g�t�@�C���̂����{�ʒu���w�肵�Ă��܂��B
����ɂ��A�e���v���[�g���t�@�C���������ŌĂяo�����Ƃ��ł���悤�ɂȂ�܂��B
��compile_dir �Ƃ��Ďw�肵�Ă���̂́ASmarty�̓e���v���[�g�������ɏ������邽�߁A�Q��ڈȍ~�̃A�N�Z�X�p�ɃL���b�V�����쐬���܂��B
���̃L���b�V����ۑ�����f�B���N�g�����w�肵�Ă��܂��B
$smarty �I�u�W�F�N�g���������A
$smarty->assign("hensu","aaa");
$smarty->display("�e���v���[�g�t�@�C����");
�̂悤�ɂ���ƁA�e���v���[�g�t�@�C�����Ŏw�肵���e���v���[�g�t�@�C����ǂݍ���ʼn�ʂɏo�͂��܂��B
�e���v���[�g�t�@�C���̒��g�́A
hensu �� {$hensu} ���ݒ肳��܂����B
�̂悤�Ȋ������Ƃ����
hensu �� aaa ���ݒ肳��܂����B
�ƁA��ʂɕ\������܂��B
�֘A�L��
- Smarty2��PHP7�ɑΉ���������@(The /e modifier is no longer supported Smarty_Compiler.class.php, line 270)
- Smarty error unrecognized tag 'assign' �g�ݍ��݊����g���Ȃ�
- �e�t�B���^�[�̓��삷��^�C�~���O
- �R���ÂJ���}���ɂ���g�����f�B�t�@�[
- �l��������A �����郂�f�B�t�@�[
- �g�ѕ\���p�ɕ�����S�p���甼�p�ɂ���
- Docomo�̌̎��ʏ��擾�p�����[�^�wNULLGWDOCOMO�x��Smarty�ŕt����
- Docomo�̌̎��ʏ��i���[�hID(guid)�擾�p�����[�^�wguid=on�x��Smarty�ŕt����
- Docomo�̌̎��ʏ��擾�����wutn�x��Smarty�ŕt����
- �R���p�C���t�@�C��(compile)���폜�ł��Ȃ�
- �ǂݍ��܂�Ă���e���v�������擾
- env , server ��ǂݍ���
- �N�b�L�[��ǂݍ���
- GET,POST�Ȃǂ̃p�����[�^��ǂݏo��
- �A�z�z��Ńp�����[�^��n�����@
- �I�u�W�F�N�g�̃����o�ϐ���ǂݍ���
- �z���ǂݍ���
�X�|���T�[�����N





