Custom Plugin

More
10 years 5 months ago #47841 by MikeSantana
Custom Plugin was created by MikeSantana
We had created a custom Flexicontent Plugin.

The plugin is working but I want to be able to call my methods from trunk/public_html/components/com_flecicontent/templates/category.php

I would like to call it as $this->mymethodname_here

where my "mymethodname_here" would depend from a variable.

Sample of my plugin Class code:
Plugin file name: Mykecode.php:
<?php defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.event.plugin');
class plgFlexicontentMikecode extends JPlugin {
function plgFlexicontentMikecode(&$subject, $params) {
parent::__construct($subject, $params);
}
function renderCatItems()
{...}
}
?>
Flexicontent/template file name: category.php:
$cat_sections = $this->params->get(...);
foreach ($cat_sections as $cat_section){
$section= 'renderCat'.ucfirst($cat_section);
##### AT THIS MOMENT IT IS WORKING LIKE THIS ####
plgFlexicontentMikecode::$section();
###### HERE IS WHAT I WOULD LIKE ####
$this->$section; OR
$this->'renderCat'.ucfirst($cat_section);
}

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #47855 by micker
Replied by micker on topic Custom Plugin
i think you are in wrong category not ? (flexicaccess and not ion develloper ?)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #47943 by MikeSantana
Replied by MikeSantana on topic Custom Plugin
Where should I post the message if custom plugin is not the place?

Mike

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #47947 by micker
Replied by micker on topic Custom Plugin
moved

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #47951 by ggppdk
Replied by ggppdk on topic Custom Plugin
Hello

if you want to call functions from inside any file via URL then you can do it as any PHP script,
... ...

but
-- you can call (via AJAX call or HTTP url) functions inside a flexicontent plugin file, our frontend controller supports this !!

Calling FLEXIcontent field functions as controller TASKs


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #47989 by MikeSantana
Replied by MikeSantana on topic Custom Plugin
Hi Emmanuel;

I do not want to call the function via URL.

I am executing /components/com_flexicontent/templates/category.php
I have a plugin installed in /plugins/flexicontent/myplugin.php

Within category.php:
##### AT THIS MOMENT IT IS WORKING LIKE THIS ####
$section = 'renderCat'.ucfirst($cat_section); NOTE:$cat_section is received with a string value like 'items', or 'subcats'

plgFlexicontentMyplugin::$section();


I want to avoid the need of calling my methods separated from the method available to my $this at the moment of components/com_flexicontent/templates/category.php instance.

###### HERE IS WHAT I WOULD LIKE ####
$this->$section; which it is the equivalent of $this->'renderCat'.ucfirst($cat_section);
}

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.449 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline