dudapiotr / ZfTable

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.
http://dudapiotrek.laohost.net/
MIT License
75 stars 59 forks source link

templateMap #8

Closed JoseManuelAbarca closed 10 years ago

JoseManuelAbarca commented 10 years ago

Hi, I'm try to use my own templates. I write my config like this:

class DataTableCompanies extends AbstractTable { protected $config = array( 'valuesOfItemPerPage' => array(5, 10, 20, 50 , 100), 'templateMap' => array( 'paginator-slide' => '../../../view/templates/slide-paginator.phtml', 'default-params' => '../../../view/templates/default-params.phtml', 'container' => '../../../view/templates/container-b3.phtml', 'data-table-init' => '../../../view/templates/data-table-init.phtml', 'custom-b2' => '../../../view/templates/custom-b2.phtml', 'custom-b3' => '../../../view/templates/custom-b3.phtml', ) );

I can't use DIR in this array and I get an error: Warning: include(../../../view/templates/custom-b2.phtml) [function.include]: failed to open stream: No such file or directory in ....

How can I use templateMap option?¿

dudapiotr commented 10 years ago

The problem is wrong path. You have to define proper path to Your template.

ionutfechete commented 10 years ago

+1..i have the same problem..

ionutfechete commented 10 years ago

if fixed it by using the construct() function. in there you can assign content to config variable by $this->config = array(etc etc);, and in there you can use __DIR .