반응형

1. 작은 따옴표와 큰 따옴표의 사용.
 a. 예시
  1) $info='Preface variables with a $ like this : $variable'; 
  2) echo "There have been $count presidents of the US";
 b. 작은 따옴표 : 정확한 내용을 유지하는 문자 그대로의 문자열을 할당하기 위함.
 c. 큰 따옴표 : 문자열 안의 $ 사용을 변수로 인지함.

2. 다중 라인 명령어.
 - <<<_END ... ... _END; 의 사용.
 - $out = <<<_END a
   b
   c
   _END;

반응형
반응형
PHP 5.3.10 Released! - PHP 보안관련 버그가 고쳐졌다고 하네요.
 
http://t.co/40ne5QN4

다음의 코드가 실행된다면?? 
http://t.co/6GSwO3n9 ㅎㄷㄷ 할듯-

바로업뎃!~~
반응형
반응형
1. jQuery 장점.

  • 최신 버전을 사용해라. (1.4 보다 1.6이 2배 가까이 빠르다)
  • id 선택자가 class 선택자보다 5-10배 이상 빠르다.
  • 가상 선택자는 느리니까 최대한 쓰지 말 것. 검색 영역의 모든 요소를 다 뒤진다!!
  • 부모에서 자식을 찾는 방법은 $parent.find(‘.child’) 가 제일 빠르다. 다른 것은 잊어라. (근데 왜 children() 이 더 안빠르지..)
  • jQuery 객체는 꼭 필요할 때에만 만들 것.
  • 항상 캐싱할 것
  • 체인 방식을 애용할 것. 이미 필터링된 집합을 이용하므로 빠르다. 코드도 간단해진다.
  • bind, live 보다 delegate가 좋다!
  • DOM insert/append 는 가급적 한번에 끝낼 것. 무거운 연산을 해야 할 경우 일단 detach 했다가 다시 넣으면 좋다.
  • $.each() 는 느리니까 그냥 for 를 쓸 수 있으면 써라.
  • $.method 보다 로레벨 함수인 $.fn.method 가 빠르다.


2. JavaScript 가 나은 경우.


jQuery
JavaScript
$(document).ready(function(){
 // code..
});   
 document.addEventListener("DOMContentLoaded",  function(){
  // code ...
});   
 
var divs = $("div");

 var divs = document.querySelectorAll("div");
 
 
var newDiv = $("<div/>");
 
 
var newDiv = document.createElement("div");
 
 

newDiv.addClass("foo");
 
 

newDiv.classList.add("foo");
 
 

newDiv.toggleClass("foo");
 
 

newDiv.classList.toggle("foo");
 
 $("a").click(function() {
  // code…
})
 
 [].forEach.call(document.querySelectorAll("a"), function(el) {
  el.addEventListener("click", function() {
    // code…
  });
});
 
 
$("body").append($("<p/>"));
 
 
document.body.
appendChild(document.createElement("p"));
 
 
$("img").filter(":first").
attr("alt", "My image");
 
 
document.querySelector("img").
setAttribute("alt", "My image");
 
 
var parent = $("#about").parent();
 
 
var parent = document.getElementById("about").parentNode;
 
 
$("#wrap").empty();
 
 
var wrap = document.getElementById("wrap");
while(wrap.firstChild) wrap.removeChild(wrap.firstChild);
 
 
if($("#wrap").is(":empty"))
 
 
if(!document.getElementById("wrap").hasChildNodes())
 
 
var nextElement = $("#wrap").next();
 
 
var nextElement = document.getElementById("wrap").nextSibling;
 
   




반응형
반응형


Yii Framework


 Yii 프레임워크는 웹2.0 어플리케이션을 개발하는데 최고의 고성능 PHP 프레임워크입니다. 오픈 소스 기반의 Yii 프레임워크는 PHP5로 쓰여졌고  DRY design 과 rapid development 를 채택하고 있습니다. 그리고 테스트와 디버그를 할 수 있도록 페키지로 되어 있는 것과 빠르며 보안 및 전문적인 특성을 가지고 있습니다.


Credits

아래는 Yii 과 관련있는 또는 영감을 준 잘 알려진 웹 프로그래밍 프레임워크의 목록 입니다.
-  
PradoRuby on RailsjQuerySymfonyJoomla


Featrues of Yii

- Model-View-Controller(MVC) design pattern
- Database Access Objects(DAO), Query Builder, Active Record, DB Migration
- Form input and validation 
- AJAX-enabled widgets
- Authentication and authorization
- Skinning  and theming
- Web servieses
- Internationalization(I18N) and localization(L10N)
- Layered caching scheme
- Error handling and logging
- Security
- Unit and functionality testing
-  Automatic code generation
- Compliance to XHTML
- Purely object-oriented
- Friendly with third-party code
- Detailed documentation
- Extension library


Performance of Yii

아래의 그림이 Yii 프레임워크가 좋은 이유를 대변해 줍니다. ㅎ;

 
결론적으로 이렇게 빠른 이유는 
 lazy loading technique 을 사용하기 때문입니다.

License of Yii Framework

Yii Framework 는 프리웨어이며 BSD License 를 따릅니다.


 
반응형

+ Recent posts