PDA

View Full Version : مشکل در ساختن two Step view Layout



Omid_h70
سه شنبه 06 فروردین 1392, 10:19 صبح
درود..

من چند وقتی هست شروع کردم به یادگیری فریم ورک زند ..و quickstart خود سایت زند و چند تا toturial دیگه رو هم دنبال کردم یکی از تاپیکشان ساختن layout بود که تو اون header و footer (مثلا) ثابت هست و بقیه بخش ها تو هر صفحه تغییر می کنه...

من Enable layout رو توسط command line انجام دادم و این محتویات فایل layout.phtml هست...(متغیر =[]resources.view هم ست کردم)



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--Edited in Version 4 14,Feb,2013 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/google.css" rel="stylesheet" type="text/css" />
<link href="styles/main_v4.css" rel="stylesheet" type="text/css"/>
<link href="styles/home_v4.css" rel="stylesheet" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>


<script src="jquery/jquery-1.8.0.min.js" type="text/javascript"></script>
<script type="text/javascript" >
$(document).ready(function(){

//setInterval(slideShowRotation,2000);
//$('#next').click(function(){
//
// $('#slideShow').animate({ 'margin-right':'100px' },5000);
//
//});



position= new Array();
var pos=1;
var TotWidth=0;

$('#slideShow img.slideContent').each(function(i){


position[i]=TotWidth;
TotWidth+=$(this).width();
if(!$(this).width())

{
alert("Please, fill in width & height for all your images!");
return false;
}


})
// if( !$(this).width() ){
// return false;
// }
// });


$('#slideShow').width(TotWidth);


$('#next').click(function(){

if(pos>4){
return false;
}
$('#slideShow').stop().animate({ marginLeft:-position[pos]+'px' } ,1500,function(){ pos++; } );



});


$('#previouse').click(function(){


if(pos<=1){
return false;
}
position[5]=2500;
backPos=position[pos]-1000;
$('#slideShow').stop().animate({ marginLeft:-backPos+'px' } ,1500,function(){ pos--; });


}) ;


$('#slideshowContainer').hover(function(){

$('#next').css({ 'display':'block'});
$('#previouse').css({ 'display':'block'});
//$('.infobox').animate();

} ,
function(){
$('#next').css({ 'display':'none'});
$('#previouse').css({ 'display':'none'});
//$('.infobox').animate();

});


});




function slideShowRotation(){





}



//My own Scripts

function show()
{
document.getElementById('login').style.display='bl ock';
}
function clean_me(field)
{

var1=document.getElementById(field).value
if(var1!='')
{
document.getElementById(field).value='';
}
}

function close_me(id_a)
{
document.getElementById(id_a).style.display='none' ;
}


</script>

<style type="text/css">

/* CSS PART DONE ! */


body{
background:-webkit-gradient(linear ,center top ,center bottom, color-stop(.1,white), color-stop(.5,#abd),color-stop(1,white)) 0px 5px no-repeat;
/*background:-moz-linear-gradient(center top ,center bottom, color-stop(.1,white), color-stop(.5,#abd),color-stop(1,white)) 0px 5px no-repeat;
background-attachment:fixed;*/
background-size:100% 100%;
}


#slideshowContainer{

width:500px;
height:320px;
overflow:hidden;
border:1px dashed green;
padding:0px;
position:relative;

}

div#slideShow{
width:2650px;
margin:10px 0px 10px 0px;
height:320px;


}

/*CSS hover parent Child better to do in a script way !


div#slideshowContainer:hover > #next ,div#slideshowContainer:hover > #previouse{
display:block;
}
*/

#slideShow img.slideContent{
list-style-type:none;
display:inline;
float:left;
width:500px;



}


#next , #previouse{
display:none;
position:absolute;
top:135px;
width:50px;
height:50px;
background:hsla(0,0%,40%,.4);
}

#next:hover , #previouse:hover{
background:hsla(0,0%,40%,.95);

}



#next{
left:0px;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
}


#previouse{
right:0px;
border-top-left-radius:10px;
border-bottom-left-radius:10px;


}

#leftArrow,#rightArrow{

border-color:transparent;
border-style:solid;
border-radius:7px;
border-width:15px;
width:0px;


}

#leftArrow{
border-right-color:hsla(156,100%,50%,.7);
margin:9px 5px 0px 0px ;
}

#rightArrow{

border-left-color:hsla(156,100%,50%,.7);
margin:9px 0px 0px 20px;

}


</style>
<title>Outer Heaven</title>
</head>
<body>

<?php

session_start();
if(isset($_SESSION['user']))
{
$user=$_SESSION['user'];
$flag=true;
}
else
$flag=false;

echo'<div class="white">';

if($flag)
{
echo'

<ul id="main_nav">
<li><a class="home" href="home.php" target="_top">&nbsp;Home&nbsp;</a></li>
<li><a class="home" href="members.php" target="_top" >&nbsp;Members&nbsp;</a></li>
<li><a class="home" href="#">Community</a></li>';
//<li><a class="home" href="#">Messages</a></li>
echo '
<li id="me"><a id="user" class="home" href="view_profile.php?view='.$user.'" target="_top" >&nbsp;'.$user.'&nbsp;</a></li>
<li><a class="home" href="log_out.php" target="_top" >&nbsp;Log Out&nbsp;</a></li>';
echo '</ul>';
}
else
{
echo'
<ul id="main_nav">
<li><a class="home" href="home.php" target="_top" >&nbsp;Home&nbsp;</a></li>
<li><a class="home" href="sign_up.php" target="_top" >&nbsp;Sign up&nbsp;</a></li>
<li><a class="home" href="sign_up.php" target="_top" >&nbsp;Shop&nbsp;</a></li>
<li id="login_position"><a class="home" href="#" onclick="show()" target="_top" >&nbsp;Log in&nbsp;</a>';


echo' <div id="login">
<div id="sharp_arrow"></div>
<form action="check.php" method="post">
<input type="text" maxlength="16" value="Username" name="user" onclick="clean_me(\'user\')" id="user"/>
<img src="icons/cross-script-icon.png" onclick="close_me(\'login\')"/>
<input type="password" maxlength="16" value="Password" name="pass" onclick="clean_me(\'pass\')" id="pass"/>
<input id="enter" type="submit" value="Sign in" class="button_google" />
<input type="checkbox" name="remember" value=""/><span >Remember me?</span>
</form>
</div>


</li></ul>';


}
echo'</div>';


?>
<?php echo $this->layout()->content; ?>



<div id="footer">
<img id="firefoxSticker" src="icons/Firefox.png" alt="firefox" title="get the best dance with Firefox!"/>
<ul id="mylinks">
<li><a class="home" href="#">Lynda</a></li>
<li><a class="home" href="#">uTorrent</a></li>
</ul>


</div>




</body>
</html>

و بقیه محتویات هم داخل views-scripts-index-index.phtml هست (که فایل خاصی نیست فقط یه slideshow و مقداری html هست)

حالا وقتی صفحه ی public رو باز می کنم (localhost/appname/public) فقط بخش header و footer من لود می شه...و برای content اصلی نوشته
on error occered
page not found

و هیچ اروری دریافت نمی کنم و اصلا نمی دونم مشکلم از کجا هست...خیلی هم سرچ کردم که مشکل چیه ولی هیچی پیدا نکردم

ممنون می شم کمکم کنید...

Edit:

Exception information:

Message: Invalid controller specified (Outer%20Heaven)

Stack trace:


#0 C:\wamp\apps\ZendFramework-1.12.3\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\wamp\apps\ZendFramework-1.12.3\library\Zend\Application\Bootstrap\Bootstra p.php(97): Zend_Controller_Front->dispatch()
#2 C:\wamp\apps\ZendFramework-1.12.3\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\wamp\www\Outer Heaven\public\index.php(32): Zend_Application->run()
#4 {main}
Request Parameters:

array (
'controller' => 'Outer%20Heaven',
'action' => 'public',
'module' => 'default',
)

ویرایش :
حل شد