1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

variable as xenoptions

Discussion in 'XenForo Development Discussions' started by timothy259856, Feb 13, 2013.

  1. timothy259856

    timothy259856 Active Member

    [​IMG]

    PHP:
        public static function totalatt(XenForo_View $view$fieldPrefix, array $preparedOption$canEdit)
        {
            
    $db XenForo_Application::get('db');
            
    $totalatt $db->fetchOne("
            SELECT count(*)
            FROM xf_attachment
            "
    );
            
    $preparedOption['option_value'] = $totalatt;
         
            return 
    XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
            
    'option_list_option_textbox',
            
    $view$fieldPrefix$preparedOption$canEdit
            
    );
         
        }
    Result:

    [​IMG]

    same total att

    but i cant add {$xenOptions.testatt} to any templates
     
  2. cclaerhout

    cclaerhout Well-Known Member

    Check first if this code is working in your template and if your option is there:
    {xen:helper dump, $xenOptions}
     
    Jake Bunce likes this.
  3. timothy259856

    timothy259856 Active Member

    dont work in page_container
     
  4. cclaerhout

    cclaerhout Well-Known Member

    I'm sure it's working there.
    Try to see if there is not a problem with one of your addon.
     

Share This Page