Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] partials with data - template library
#1

[eluser]patie[/eluser]
Hi,

please tell me how i get partials with data in phil sturgeon template library. (or other good library)

i need "post" data to partial like "posting" to view..

in view : $this->template->build('view_name', $data); and i need some like this for partial..

(for example.. i need "mini panel" as poll, ads, mini news.. only on some pages )

can you help me ? :/

SORRY FOR POOR ENGLISH
thanks
#2

[eluser]patie[/eluser]
any idea ?
#3

[eluser]umefarooq[/eluser]
its really easy to use this library's partials and you can use on pages you like with or without Dwoo template parser if you are using with this library

Code:
$this->template->set_partial('partial_name', 'view_name');

  now in your main or page view you have find out either key exist in template partials array

without Dwoo library
  if(key_exists('partial_name',$template['partials']))
  $template['partials']['parials_name'];

with Dwoo parser

{if key_exists('parials_name', $template.partials)}
{$template.partials.parials_name}
{/if}
#4

[eluser]patie[/eluser]
OMG !!! THANKS MAN

in phil sturgeon template library works it too..




Theme © iAndrew 2016 - Forum software by © MyBB