Search the Community
Showing results for tags 'title'.
-
I am almost finished the book, and I am not totally clear on how to use the $page_title variable that appears throughout the book, do we have to include the following code in the title tag of each php script in order to use $page_title. <?php echo $page_title; ?>. In most of the examples in this book the $page_title variable is used in the script without showing the code used in the title tag. Also since the $page_title variable appears below the title tag when I load the php script in my browser I get an error message saying that $page_title isn't a valid variable. Can someone explain to me how to properly use the $page_title variable when writing php scripts. Or is it just easier to write the title in the title tag without using this variable.
-
Version 0.5 Two questions about page 115. 1. Quoting from the book: "<?php $this->pageTitle = Yii::app()->name . '::' . $model->title; ?>" Why are there two colons before $model->title ? I assume they will appear literally, but maybe they function as code -- I'm not sure. 2. Quoting from the book again: "{TIP} Because the page title is set by assigning a value to the controller instance, it can also be set within the controller action, if you’d rather." This sentence is saying 2 things, neither of which I understand. Larry, can you please break this down and provide an example? Thanks.
-
I've been trying to get this for a while (includes jQuery) and somehow nothing seems to work. The image gallery works fine but won't display title. $(document).ready(function() { var pics=[]; for (var x=0; x<preLoadPics.lenght;x++) { pics[x]=new Image(); pics[x].src=preLoadPics[x]; } var newPix=new Image(); newPix.src=preLoadPics[0]; $('#thumbPix a').click(function(evt){ evt.preventDefault(); var pixFile=$(this).attr('src'); var pixLink=$(this).attr('href'); var pixTitle=$(this).attr('title'); var oldPix=$('#pix img'); var newPix=$('<img src="'+pixLink+'">'); if(pixLink==oldPix.attr('src')){ return; }else{ $('.selected').removeClass('selected'); //add highlight to this thumbnail $(this).addClass('selected'); //make new image invisible newPix.show(); //add to the #pix div $('#pix').prepend(newPix); newPix.show(); //fade out old image and remove from DOM oldPix.fadeOut(0,function(){ $(this).remove(); }); //fade in new image newPix.fadeIn(0); oldPix.remove(pixFile,'^Lg+\w\.'); } }); //end click $('#thumbPix a:eq(0)').click(); }); //end ready </script> this is body section <div id="thumbPix"> <li><a href="LgPicture.jpg" id="pix"title="Picture"> <img src= "smallPicture.jpg" border="2" bordercolor="#cccc99"/>Picture<br /></a></li> One option that doesn't break it completely is adding pixTitle to the .prepend in the Javascript code. I got it to display title, but then it just builds the titles instead of replacing it. $('#pix').prepend(newPix,pixTitle); newPix.show(); any ideas? Thanks
- 6 replies
-
- image gallery
- title
-
(and 2 more)
Tagged with: