• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
PHPTAL with CakePHP
 

PHPTAL with CakePHP

on

  • 8,052 views

第一回デザイナー向けCakePHP勉強会のLT発表資料です。PHPTALの概要、CakePHPでの利用方法について紹介します。

第一回デザイナー向けCakePHP勉強会のLT発表資料です。PHPTALの概要、CakePHPでの利用方法について紹介します。

Statistics

Views

Total Views
8,052
Views on SlideShare
5,047
Embed Views
3,005

Actions

Likes
1
Downloads
12
Comments
0

24 Embeds 3,005

http://d.hatena.ne.jp 1862
http://php-tips.com 852
http://flavors.me 76
http://blog.direct-search.jp 69
http://iteman.tumblr.com 25
http://localhost 22
http://feeds.feedburner.com 18
http://webcache.googleusercontent.com 15
http://jp.flavors.me 15
https://twitter.com 12
http://fr.flavors.me 5
http://twitter.com 5
http://de.flavors.me 5
http://cache.yahoofs.jp 4
http://coderwall.com 4
http://es.flavors.me 4
http://paper.li 3
http://b.hatena.ne.jp 2
http://pt.flavors.me 2
http://us-w1.rockmelt.com 1
http://www.slideshare.net 1
http://ps.googleusercontent.com 1
http://cakephp.inop.info 1
http://slideclip.b-prep.com 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    PHPTAL with CakePHP PHPTAL with CakePHP Presentation Transcript

    • PHPTAL with CakePHP July 2011 CakePHP
    • About Me• WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / MySQL / iPhone / / / / / / / / no more• BLOG: http://php-tips.com/• TWITTER: @nojimage
    • Template Engine
    • Template Engine• HTML• Smarty, Twig, PHP, PHPTAL, etc...
    • Data Template Template Engine HTML, RSS Feed, etc...
    • PHPTAL
    • TAL• XHTML(XML)• http://wiki.zope.org/ZPT/TAL
    • Templae Attribute Language• XHTML(XML)• http://wiki.zope.org/ZPT/TAL
    • PHPTAL• Zope TAL PHP• http://phptal.org/• http://phptal.org/manual/ja/
    • code
    • Data
    • $people = array( array( ‘name’ => ‘Taro Yamada’, ‘phone’ => ‘090-0000-0000’ ), array( ‘name’ => ‘Hisateru Tanaka’, ‘phone’ => ’06-XXXX-XXXX’ ), // ...);
    • HTML
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr> <td>persons name</td> <td>persons phone</td> </tr> <tr> <td>sample name</td> <td>sample phone</td> </tr></table>
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr> <td>persons name</td> <td>persons phone</td> </tr> <tr> <td>sample name</td> <td>sample phone</td> </tr></table>
    • PHP
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> <?php foreach ($people as $person) : ?> <tr> <td><?php echo $person[name]; ?></td> <td><?php echo $person[phone]; ?></td> </tr> <?php endforeach; ?></table>
    • Smarty is not smart...
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> {foreach from=$people item=person} <tr> <td>{$person.name}</td> <td>{$person.phone}</td> </tr> {/foreach}</table>
    • PHPTAL
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr tal:repeat="person people"> <td tal:content="person/name">personsname</td> <td tal:content="person/phone">personsphone</td> </tr> <tr tal:replace=""> <td>sample name</td> <td>sample phone</td> </tr></table>
    • <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr tal:repeat="person people"> <td tal:content="person/name">persons HTMLname</td> <td tal:content="person/phone">personsphone</td> </tr> <tr tal:replace=""> <td>sample name</td> <td>sample phone</td> </tr></table>
    • in Browser
    • in Browser
    • in Browser
    • in BrowserHTML
    • HTML
    • PHPTAL• 1. tal:define 7. tal:attributes 2. tal:condition 8. tal:on-error 3. tal:repeat 9. metal:define-macro 4. tal:omit-tag 10. metal:use-macro 5. tal:replace 11. metal:define-slot 6. tal:content 12. metal:fill-slot
    • PHPTAL is Smart!
    • PHPTAL
    • PHPTAL withCakePHP
    • CakePHP-TALTAL plugin
    • https://github.com/nojimage/ CakePHP-TALTAL
    • Feature• html, xhtml, zpt PHPTAL• ctp PHP OK•
    • Feature• url, fullurl• cake:helper
    • Installation• git clone or download• set to plugins/taltal• write to AppControllerclass AppController extends Controller { // ...(snip) public $view = Taltal.Phptal; // ...(snip)}
    • Let’s Try PHPTAL!! PHPTAL
    • CakePHP-TALTAL• https://github.com/nojimage/CakePHP-TALTAL• since 2011/06/01• version 0.3.1