Saturday, December 27, 2008

Re: How can i change the layout of cakephp pages

The SQL log is displayed when debugging is set to 2 or above. Open
config/core.php and set Configure::write('debug', 1);

To get alternating row colors you can use the modulus operator in
PHP. If you use bake, you'll see an example in an index.ctp view.

...
<?php
$i = 0;
foreach ($posts as $post):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
...

...then use CSS to style the .altrow class accordingly.

On 27 Dec, 17:42, mona <poojapinj...@gmail.com> wrote:
> When i edit default.ctp file in cake php it doesn't work can i use
> table as normal php and set my layout i m using fieldset so how can i
> adjust the size of that fieldset i tried alot but doesn't success can
> we design page in cakephp as simple php and how i can disable the sql
> log table from my pages it is displayin in php 1.2 .If i delete all
> the contents of default.ctp does it cause any problem.One thing in the
> index i m displaying a table and i wan't to give alternate rows
> different colors how it is possibe i m using foreach loop to display
> the contents of table
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: