|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
drfranca Smarty n00b
Joined: 05 Jul 2011 Posts: 3
|
Posted: Tue Jul 05, 2011 9:04 pm Post subject: Block plugin to select what a want to show |
|
|
Im implementing a export system from HTML to PDF and i need do mark what part of the code i want to show in case of export like:
{export}
// title
{/export}
// menu // i dont want to export
{export}
// content
{/export}
Any idea?
ps.: sorry for the bad english. |
|
Back to top |
|
drfranca Smarty n00b
Joined: 05 Jul 2011 Posts: 3
|
Posted: Wed Jul 06, 2011 1:55 pm Post subject: The begining |
|
|
Code: | function smarty_block_export($params, $content, &$smarty, &$repeat)
{
//echo '<pre>';
//var_dump($smarty);
//die;
$ex = isset($smarty->get['export']) && (int)$smarty->get['export'];
switch ( $params['func'] ) {
case 'exclude':
$content = $ex ? '' : $content;
break;
case 'content':
$content = $ex ? $content : '';
break;
default :
$content = $ex ? $content : '';
break;
}
return $content;
} |
That's my code until now, but i dont receive the GET data inside the plugin, how can i get that?
I try:
Code: | $smarty->get['export'] | But no results. |
|
Back to top |
|
drfranca Smarty n00b
Joined: 05 Jul 2011 Posts: 3
|
Posted: Wed Jul 06, 2011 2:07 pm Post subject: Sorry guys |
|
|
Sorry guys, this works
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|