my stupid mistake,
Now I get :
plugin error - My::Blahcreate needs a hashref at /usr/lib/perl5/vendor
+_perl/5.8.2/i686-linux/Template/Plugins.pm line 119
hmm, thinking....i now wonder that i have to do it other way...or something like that I cant figure out what is the right approach to my problem..
I have subclassed Class::DBI. In these subclases I created some methods like the shown above.
On the other hand I made a View-object which use Template toolkit to do the HTML rendering.
So now I want to access Class::DBI-subclasses methods from within the templates.
This way baypassing data "retransmission" in my asp (ASP.pm) scipts. Here is snippet of example asp script :
my $model = $class->retrieve_all();
$view->variables(data => $model, id => $Request->Params('id') );
$view->variables(list_columns => [ $class->cols('list') ] );
I want to not use the last line, but have the ability to
call them directly in the template.
I'm also wondering 'cause this in some sense will break
MVC approach, but on other hand these are just 'informational' methods (i.e. i do not plan yet :")) to do
some html-rendering there..
what is your advise ?
PS.
|<? FOR name = data.cols('list')?>
<?name ?>
<?END?>|
doesnt seem to do it. Do I do something very stupid here or this is just my feeling :")
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.