Thứ Tư, 6 tháng 6, 2012

[Symfony2] Chi tiết luồng xử lý form

There are two types of events:
DataEvent - read-only access to the form data. 'Pre' and 'Post' events are read-only.
FilterDataEvent - event that allows the form data to be modified.
form.pre_bind DataEvent triggered before data is bound to the form. Triggered by Symfony\Component\Form\Form::bind()
form.post_bind DataEvent triggered after data is bound to the form. Triggered by Symfony\Component\Form\Form::bind()
form.pre_set_data DataEvent triggered before fields are filled with default data. Triggered by Symfony\Component\Form\Form::setData()
form.post_set_data DataEvent triggered after fields are filled with default data. Triggered by Symfony\Component\Form\Form::setData()
form.bind_client_data FilterDataEvent triggered before data is bound to the form. Triggered by Symfony\Component\Form\Form::bind()
form.bind_norm_data FilterDataEvent triggered after data has been normalized. Triggered by Symfony\Component\Form\Form::bind(). See Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener (added by the UrlType for an example)
form.set_data FilterDataEvent triggered while default data is being bound. Triggered by Symfony\Component\Form\Form::setData()
I'd recommend poking around the Form class itself to get a better feel for when these events are triggered, and how you can use them.

Thứ Ba, 5 tháng 6, 2012

[Symfony2] Lỗi khi dùng Sonata Admin với Oracle

Lỗi không hiểu ngày tháng:
1. Chỉnh sửa Session của Oracle (có thể ko cần)
ALTER SESSION set NLS_DATE_FORMAT = "YYYY-MM-DD HH24:MI:SS";
2. Thêm vào cấu hình config.yml:
services:
   my.listener:
      class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
      tags:
          - { name: doctrine.event_listener, event: postConnect }
3. Lỗi set null ID: bổ sung trigger cho Oracle

Thứ Sáu, 21 tháng 10, 2011

Link repo download CentOS

http://mirror-fpt-telecom.fpt.net/centos/5.6/isos/i386/
http://mirror-fpt-telecom.fpt.net/centos/5.5/isos/i386/
http://mirror-fpt-telecom.fpt.net/centos/6.0/isos/i386/

x86_64:
http://vault.centos.org/5.6/os/x86_64/CentOS/

Thứ Hai, 3 tháng 10, 2011

Thứ Bảy, 24 tháng 9, 2011

Fix lỗi thẻ embed trên IE

<!--start_raw-->
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("player4", "9.0.0");
</script>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="365" height="312" id="player4">
<param name="movie" value="player.swf">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="flashvars" value="file=/wp-content/filmMarco.flv">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="player.swf" width="365" height="312">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="flashvars" value="file=/wp-content/filmMarco.flv">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<!--end_raw-->

Thứ Ba, 16 tháng 8, 2011

Chú ý khi cài mới UBUNTU

Chỉnh kích thước màn hình: http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html
Cài java6-jdk: