Witam wszystkich serdecznie. Jako, że już ponad 2-3 tygodnie uczę się Zenda, postanowiłem w ramach nauki stworzyć stronę dla firmy sprzedającej meble. Posiadają już oni strony, więc także posiadają hosting, na moje nieszczęście w home.pl ;/ Aplikacja, którą stworzyłem bez problemów działa na localhoscie. Natomiast mam problemy z jej działaniem a raczej, konkretnie z 1 tylko akcją, po pozostałe działają. Problem opiszę po kolei, taką posiadam strukturę plików:
(IMG:
http://images50.fotosik.pl/338/09bd3e92c3c7b8c1.png)
Rozwiązałem problem z trawersowaniem katalogów, przy pomocy pliku .htaccess (w folderze public usunąłem plik .htaccess, został tylko index.php), o takiej zawartości:
Kod
RewriteEngine On
RewriteBase /salonbiasov
RewriteCond %{REQUEST_FILENAME} !/public/ [NC]
RewriteRule ^(.*)$ /public/$1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^public/.*$ /public/index.php [NC,L]
Wszystko ładuje się OK, oprócz 1 akcji w kontrolerze IndexController:
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->redirector->setUseAbsoluteUri(true);
}
public function indexAction()
{
//strona glówna
}
public function kontaktAction()
{
$tekst=new Zend_View();
$tekst->setScriptPath(APPLICATION_PATH . '/views/scripts/adminstatic/');
$this->view->tekst=$tekst->render('kontakt.phtml');
}
public function wspolpracaAction()
{
$model = new Application_Model_DbTable_Wspolpraca();
$this->view->dane = $model->getAll();
$this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
.DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'wspolpraca'
.DIRECTORY_SEPARATOR;
}
public function ofirmieAction()
{
$tekst=new Zend_View();
$tekst->setScriptPath(APPLICATION_PATH . '/views/scripts/adminstatic/');
$this->view->tekst=$tekst->render('ofirmie.phtml');
}
public function promocjeAction()
{
$model = new Application_Model_DbTable_News();
$this->view->dane = $model->getAllNews();
$this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
.DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'news'
.DIRECTORY_SEPARATOR;
}
public function showitemAction()
{
$model = new Application_Model_DbTable_Item();
$id = $this->_getParam('id',1);
$this->view->dane = $model->getItemByCategory($id);
$this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
.DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'items'
.DIRECTORY_SEPARATOR;
}
}
Widok dla akcji showitemAction()
<?php if(empty($this->dane)):?> <h1>BRAK ASORTYMENTU</h1>
<? endif ?>
<? foreach($this->dane as $k=>$v):?>
<div class="item">
<img src="<?=$this->thumb($this->path . $v['img'], 175, 175);?>" />
<span class="name"><?=$v['nazwa'];?></span><br />
<span class="price"><?=$v['cena'];?> zł</span>
</div>
<? endforeach ?>
problem jest z akcją showitemAction(), uruchomienie jej powoduje:
Kod
500 Internal Error
The server encountered an internal error and could not complete your request.
ale tylko na serwerze home.pl na localhoscie wszystko jest OK (IMG:
style_emoticons/default/exclamation.gif)
Na początku myślałem, że to problem z routerem, więc tak rozpisałem trasy w bootstrappie:
$router->addRoute('produkty7',
new Zend_Controller_Router_Route
('pokoj_hotelowy.html', array( 'controller'=>'index',
'action'=>'showitem',
'id'=>7,
)));
$router->addRoute('produkty8',
new Zend_Controller_Router_Route
('meble_kuchenne.html', array( 'controller'=>'index',
'action'=>'showitem',
'id'=>8,
)));
$router->addRoute('produkty9',
new Zend_Controller_Router_Route
('materace.html', array( 'controller'=>'index',
'action'=>'showitem',
'id'=>9,
)));
Czy ktoś może mi pomóc odnośnie tego problemu (IMG:
style_emoticons/default/questionmark.gif) Chciałbym zaznaczyć, że na nazwa.pl wszystko działa (IMG:
style_emoticons/default/exclamation.gif)