Cargar parámetros propios para TCPDF en el bundle WhiteOctoberTCPDFBundle

97 views
Skip to first unread message

Jeronimo SALAZAR RAMIREZ

unread,
Jun 2, 2014, 11:07:07 AM6/2/14
to symfo...@googlegroups.com
Buen día.

Estoy usando el bundle Symfony 2.3 y el bundle WhiteOctoberTCPDFBundle, necesito definir algunos valores para las constantes que usa el TCPDF, así que las defino en el config.yml.

white_october_tcpdf:
    tcpdf:
        k_tcpdf_external_config: true
        k_path_images: '%kernel.root_dir%/../web/images/'
        k_path_fonts: '%kernel.root_dir%/../vendor/tecnick.com/tcpdf/fonts/'
        pdf_margin_bottom: 15

Pero el bundle solo define las que empiezan con k_path de acuerdo al código en el archivo vendor/whiteoctober/tcpdf-bundle/WhiteOctober/TCPDFBundle/WhiteOctoberTCPDFBundle.php


// All K_ constants are required
if (preg_match("/^k_/i", $k))
{
    if (!defined($constKey))
    {
    $value = $this->container->getParameterBag()->resolveValue($v);

    if (($k === 'k_path_cache' || $k === 'k_path_url_cache') && !is_dir($value)) {
        $this->createDir($value);
    }

    define($constKey, $value);
    }
}


Investigando encontre esto http://stackoverflow.com/questions/13235808/change-whiteoctober-tcpdf-bundle-configuration-values

Agregar el siguiente código al  bundle


if (preg_match("/^pdf_/i", $k)) {
  if (!defined($constKey)) {
    define($constKey, $v);
  }
}
Me gustaría que me dieran su opiniones de donde los podría definir.

--
-------------------------------------------------------
Si programas  en PHP, usa Symfony
-------------------------------------------------------
Navega mas seguro con FireFox
------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages