hi

I want to write a snippet that would select a random banner from the
database and display it on screen. banners belong to different size
categories, and I would like the person who will be using this website to
decide where the banners would appear easily. Therefore i would like them to
be able to insert a code like:

<?php $randombanner('size') ?> in any part of a view file that they select,
and then the script to randomly choose a banner of the defined size.

and here's where the problem is.
I don't quite understand what how should I define the script, as:

a) if I choose it to be component - I can't execute it from the view level
b) if I choose it to be helper and gather all banners from the database in
e.g. app_controller, then it's not very efficient as with every load of any
page, it will run a search through the mysql database, even if there's no
need for the banner on that page. as well es I would have to execute the
code this way <?php $randombanner('size',$banners) ?> where $banners is an
array of all my banners available.

sorry if the question is daft, but I'm new to cakePHP and still have some
problems with understanding how it works.

many thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to