Tuesday 14 September 2010 4:41:08 am - 8 replies

» Read full tutorial

Introduction

This tutorial will explain how template fetch functions work and how to develop custom ones. It will also show you how to call them from PHP.

 
Author Message

SEBBANE Alexandre

Wednesday 15 September 2010 6:43:03 am

Cool, you want the award this year or not ?

Paris, France

Romeo Antony

Wednesday 15 September 2010 11:15:34 am

So simple. It can easily understandable even for a newbie.

I appreciate your time and work for this great article.

I have a suggestion ,it would have been a better idea if you could include some cutom fetch example that make some sense

in the php method ,

<span>public</span> <a href="http://www.php.net/static" mce_href="http://www.php.net/static" target="ez_no_documentation"><span>static</span></a> <span>function</span> getMyFetchFunctionResult<span></span>

Romeo Antony

Oman , GCC

Jérôme Vieilledent

Wednesday 15 September 2010 12:10:05 pm

Hi Romeo

I don't really get your suggestion :/...

Could you be more explicit please ?

Romeo Antony

Wednesday 15 September 2010 1:21:27 pm

Thank you for the followup Jerome.

In function , you did like this

$result = array(
'first_key' => 'foo',
'second_key' => 'bar'
)

I know ,It is for simplicity. instead of that, if you show some meaningful custom fetch function operations with parameters could be really helpful .Since this article is fully focusing on extending custom fetch function .

Anyway I really enjoyed this article. This week beginning I have just started on try to develop simple extensions. This article is an additional help for my tries.

Anders Berre

Friday 17 September 2010 2:05:41 am

Nice tutorial, very good work!

I think this is one of my favorite functionallity with eZ Publish. Have made many custom fetches to make things easy! :-)

Sincerely,

Anders Sandvik Berre
http://www.netmaking.no/

André R.

Monday 20 September 2010 3:49:45 am

Nice article, however I don't see the need to have an catch all try block on the "How it works" page. 1. No fetch functions use exceptions, they use null/false normally to indicate issues. 2. pokemon exceptions handling ( "Gotta Catch 'Em All" ) ? :)

As in: basically only use try block if the api your using uses exceptions, and then stricten the match for those exceptions instead of unintentionally catching exceptions your not supposed to handle(that might show up in the future, lets say for mvc exceptions for instance).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jérôme Vieilledent

Thursday 23 September 2010 5:06:24 am

Hi everyone

Thanks for your nice feedback :)

André : Actually, I always use try/catch blocks as I always use exceptions in case of errors. This is just a (nice) habit ;-)

Joël LEGER

Monday 04 October 2010 1:49:42 am

Hi Jérôme,

Clear and neat tutorial ... perfect work.

Joël

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 23:44:33
Script start
Timing: Jan 29 2025 23:44:33
Module start 'layout'
Timing: Jan 29 2025 23:44:33
Module start 'content'
Timing: Jan 29 2025 23:44:33
Module end 'content'
Timing: Jan 29 2025 23:44:33
Script end

Main resources:

Total runtime0.0112 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.2656151.2266
Module start 'layout' 0.00400.0016 739.492236.6797
Module start 'content' 0.00570.0045 776.1719102.8906
Module end 'content' 0.01010.0011 879.062541.9922
Script end 0.0112  921.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002017.8388140.0001
Check MTime0.00108.5382140.0001
Mysql Total
Database connection0.00065.735310.0006
Mysqli_queries0.001513.071730.0005
Looping result0.00000.072210.0000
Template Total0.00087.410.0008
Template load0.00075.913710.0007
Template processing0.00021.452410.0002
Override
Cache load0.00054.142810.0005
General
dbfile0.00119.797480.0001
String conversion0.00000.038240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs