본문 바로가기

FrameWork/ZendFrameWork13

Zend_Layout 12월 11일 core로 이동. svn에는 존재하나 1.0.3버전에는 포함안됨. 예제) http://akrabat.com/2007/12/11/simple-zend_layout-example/ 부트스트랩파일 index.php에서 layout객체 생성. 옵션으로 관련설정을 주거나 추후 변경가능. Zend_Layout::startMvc(); 무옵션일 경우 /application/views/scripts 디렉토리의 layout.phtml 파일을 사용함. layout.phtml 파일에서 해당 콘트롤러의 해당 액션.phtml 을 렌더링한 결과를 기본적으로 content 로 가져옴. 콘트롤러에서 렌더링 한 결과를 response객체의 named segment 로 지정해 놓으면 레이아웃객체에서 사용가능. $this->.. 2008. 8. 13.
response named segment $this->_helper->viewRenderer->setResponseSegment('common'); 현재 액션의 렌더링 결과가 common 이라는 이름의 세그먼트로 저장됨. layout script에서 아래와 같이 사용. --> 됨. --> 안됨. --> 됨. view script에서는 모두 안됨. -> default 세그먼트라서?!! 2008. 8. 13.
Zend_Acl_Assert class Local_Acl extends Zend_Acl { public function __construct() { $this->addRole(new Zend_Acl_Role('guest')); // 기본 롤 $this->addRole(new Zend_Acl_Role('member'), 'guest'); $this->addRole(new Zend_Acl_Role('admin'), 'member'); $this->add(new Zend_Acl_Resource('admin')); $this->add(new Zend_Acl_Resource('member'), 'admin'); $this->add(new Zend_Acl_Resource('default'), 'member'); // 기본 리소스 $this->.. 2008. 8. 13.
ErrorHandler, ViewRenderer 사용않기 ErrorHandler와 ViewRenderer는 기본으로 등록되어 있으므로 사용하지 않으려면 아래와 같이.. 프론트 콘트롤러에서 $front->setParam('noErrorHandler', true); $front->setParam('noViewRenderer', true); 콘트롤러 액션에서 $this->_helper->viewRenderer->setNoRender(); 2008. 8. 13.
Zend_Translate - array 사용 $lang_en = array( 'active' => 'active', 'deactive' => 'deactive', 'Value is empty, but a non-empty value is required' => 'Value is empty, but a non-empty value is required' ); $lang_ko = array( 'active' => '활성', 'deactive' => '비활성', 'Value is empty, but a non-empty value is required' => '값이 비었습니다. 값을 입력해주세요.' ); $trsl = new Zend_Translate('array', $lang_en, 'en'); $trsl->addTranslation($lang_ko,.. 2008. 8. 13.
Zend_View Helper - form element 태그 생성하기 view에서 자주, 반복적으로 사용되는 function 을 클래스로 모아놓는 것 같음. ^^; 기본적으로 제공되는 initial helper form 관련 태그를 자동으로 생성해준다. 의 형식으로 사용한다. name은 태그이름, value는 태그값, attribs는 태그 기타설정값(size=12, maxlength=20 등의 정보를 array형태로 전달) 은 아래의 태그로 변환. 은 아래. O X isActive는 태그이름 X는 초기선택값 null 모름 array() 선택가능 항목 'a' => 'b' --> b formHidden, formRadio, formSubmit 등 여러메소드가 있으며 기본적으로 name, value, attribs 등의 비슷한 인자를 갖음. 기타 자세한 것은 소스를 참고하면 쉽.. 2008. 8. 13.
자신이 만든 또는 3rd party 라이브러리 autoloading 하기 http://framework.zend.com/manual/en/zend.controller.subclassing.html#zend.controller.subclassing.conventions 위의 형식에 따라 자신이 만든 라이브러리나 3rd 파티 라이브러리를 설치했을 경우 해당 클래스를 사용하기 전에 require_once 나 Zend::loadClass() 등으로 미리 로딩해줘야 한다. 처럼 매 클래스파일마다 작성하기가 번거롭다고 느낄 경우.. include 'Zend.php'; /** * Register Zend::loadClass() as autoload method. Loads PEAR-style * (My_Name_Is_Foo is located in My/Name/Is/Foo.php) cl.. 2008. 8. 13.
Simple Zend_Layout Example Zend_Layout is in the trunk now, so here's a super simple MVC example that shows it in action: This example consists of three view files: the outer layout file, the index action view script and a right hand side bar. The remainder of this post describes the key files. If you just want to poke around with the code, then it's at the bottom, so page down now! Setting up This is the directory layout.. 2008. 8. 13.
일반 php에서 Zend Framework Library 사용하기 위한 설정 Daniel Vecchiato님(?)의 Using Zend Framework components in Code Igniter에서 잘 설명이 되어있는데요. CodeIgniter가 아니더라도 일반 php 프로그래밍에서도 적용이 가능합니다. 참고할 부분은 include_path에 Zend Framework가 설치된 경로를 추가하는 부분인데요. ini_set('include_path', ini_get('include_path').':'.Zend Framework Path); 입니다. 기본적인 php 설명은 생략합니다. ^^; 다만 저는 개인적으로 만들어놓은 Framework를 사용하고 부족한 부분을 외부 Library는 따로 모아서 관리하고 최대한 가벼운 Library를 사용하기 위해 global functio.. 2008. 8. 13.
Zend Framework 설치하기 APM등이 설치되어 있어야 합니다아래의 폴더명은 제가 정의한 것이며 zend framework 메뉴얼에 보시면 비슷한 패턴으로 폴더를 지정하라는 내용이 있습니다.~/_app      /controllers      /models      /views~/_lib~/document_root  이방식은 Zend에서 권장하는 방식이며 외부에서 라이브러리폴더나 로직파일들에 대한 직접적인 접근을 배제할수 있습니다. http://framework.zend.com/download/stable 에서 소스를 다운 받습니다.압축을 풀어보시면 library폴더가 있고 그안에는 Zend.php , Zend폴더가 있습니다. 이것을 ~/_lib에 복사를 하십시오.document_root 폴더에 .htaccess .. 2008. 8. 13.
Zend Framework의 설치와 환경설정 ※ 테스트 환경 : Apache 2.2.4, PHP 5.2.1, MySQL 5.0.33 (RWAPM X-Server) 1. Zend Library 준비 - Zend Framework 사이트에서 최신 버전(2007-03-12 현재 ver0.8.0)을 다운 2. 디렉토리 구조 - Choosing Your Application's Directory Layout의 'Conventional' layout에 따름 /zend .htaccess index.php /application /config /controllers /models /views /htdocs /images /scripts /styles /library /Zend /(other libraries) /tmp /sessions /cache /view_c.. 2008. 8. 13.
zendFramework 설치 ※ 테스트 환경 : RWAPM 기본적인 셋팅은 http://framework.zend.com/manual/ 메뉴얼 7장 참고 /rwapm /Zend_Framework /Zend /www /_BIZ /_DAC /_template /_DATA /_catch /_complie /_FRAMEWORK (젠드프레임웍을 좀더 사용하기 쉽게 몇몇 파일 재구성) 이번에 닷넷프로젝트 하면서 biz, dac, model 영역까지 다 따로 잡아줬었는데 php에서는 그렇게 까지 해야되나 하는 의문이 들어서 일단은 model부분은 제외, (비즈니스단도 없어질지 모름) 또 ajax를 이용하면 특정 페이지를 xml문서로 만들어줘서 전달해줘야되는 경우가 발생하는데 이때 이것을 처리할 _handle??폴더가 생길지도 모름; 참고적으로 .. 2008. 8. 13.
젠드 프레임웍 한글메뉴얼 ZendFramWork 젠드 프레임 워크 한글 메뉴얼 HTML 형식 2008. 8. 8.