Jump to content

tourshi

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by tourshi

  1. Hi, I'm new to PW and still a novice in PHP. I was just wondering how does one access PW within a function? do I pass the entire $page variable to getTitle()? or do I use global $page within the function...I'm confused.. Especially considering there must be a performance penalty for passing entire page variable when I only need a few variables from it (for example $page->long_title, $page->menu_title, $page->short_title). function getTitle() { $long_title = $page->long_title; $title = !empty($long_title) ? $long_title : $page->title; return $title; }
×
×
  • Create New...