Forums / Developer / Texttoimage in php mode

Texttoimage in php mode

Author Message

Sébastien Morel

Tuesday 09 October 2007 2:40:27 am

Hi,

I try to find a way to call the equivalent php function of the template operator texttoimage('myclass');

I don't find this in the kernel, or in lib. I haven't searched deeply, i want to know if somebody knows...

Somebody knows ?

Thanks,

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sébastien Morel

Tuesday 09 October 2007 9:51:25 am

Hi, I find the way ;)

function imageTitre($titre) {
		 include_once( 'kernel/common/template.php' );
       	 $tpl =& templateInit();  
         $tpl->setVariable( 'title',$titre);
	     $templateResult =& $tpl->fetch( 'extension/xajax_offres/design/standard/templates/t2img.tpl' );
	     return $templateResult;
	}

t2img.tpl :

<!--{$title}-->{$title|texttoimage('oseo_image_titre_content_xajax_titre')}

++
;)

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Damien Pobel

Tuesday 09 October 2007 10:58:54 am

Hi Sébastien,

your solution is quite elegant :)
When I'm looking for the définition of a template operator, I use this command under Linux :

find -name \*.php -exec grep -il 'texttoimage' {} \;

<i><!--{$title}-->{$title|texttoimage('oseo_image_titre_content_xajax_titre')}</i>
tient OSEO :-)

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Sébastien Morel

Tuesday 09 October 2007 2:42:53 pm

Yep,

Before finding an another method (with the template), I have browse the kernel and the lib to find the php code... but no. I don't see how do that.
Even, with your grep, me I use Ctrl+F : find in File :p

I'm very curious to know how use this operator directly in php.

Thanks for the crazy eZ developpers who knows and who could explain that ;)

++

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

eZ debug

Timing: Jan 20 2025 23:23:08
Script start
Timing: Jan 20 2025 23:23:08
Module start 'content'
Timing: Jan 20 2025 23:23:09
Module end 'content'
Timing: Jan 20 2025 23:23:09
Script end

Main resources:

Total runtime0.7873 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 588.9844180.8438
Module start 'content' 0.00830.6779 769.8281591.2344
Module end 'content' 0.68620.1010 1,361.0625336.7578
Script end 0.7872  1,697.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4928210.0002
Check MTime0.00150.1877210.0001
Mysql Total
Database connection0.00110.135910.0011
Mysqli_queries0.701389.07551970.0036
Looping result0.00180.22881950.0000
Template Total0.756296.120.3781
Template load0.00270.337420.0013
Template processing0.753595.715420.3768
Template load and register function0.00020.021410.0002
states
state_id_array0.00110.136710.0011
state_identifier_array0.00060.080320.0003
Override
Cache load0.00220.2754330.0001
Sytem overhead
Fetch class attribute can translate value0.00120.150530.0004
Fetch class attribute name0.00110.141260.0002
XML
Image XML parsing0.00280.360630.0009
class_abstraction
Instantiating content class attribute0.00000.002280.0000
General
dbfile0.00911.1592330.0003
String conversion0.00000.001230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs