0
Şimdi sorun şu an değil. ama düzeni veya phtml yükleyemiyorum gibi görünüyor. bu benim kodDüzeni yüklenemiyor ya da phtml algılanmadı algılamıyor
Config.xml
<modules>
<Email_Rent><!-- code/local/Email/Rent-->
<version>1.0.0</version>
</Email_Rent>
</modules>
<global>
<!-- Declare block class -->
<blocks>
<rent><!-- route -->
<class>Email_Rent_Block</class>
</rent>
</blocks>
</global>
<frontend>
<routers>
<rent>
<use>standard</use>
<args>
<module>Email_Rent</module>
<frontName>rent</frontName>
</args>
</rent>
</routers>
<!-- declare layout for block -->
<layout>
<updates>
<rent><!-- route -->
<file>rent.xml</file>
</rent>
</updates>
</layout>
</frontend>
bu i HAVA
<layout version="0.1.0">
<rent_index_index>
<reference name="content">
<block type="rent/indexblock" name="form_rent_block" template="rent/rent_form.phtml" />
</reference>
</rent_index_index>
rent.xml olduğunu Dizin denetleyicimde var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
'u yerleştirin. ve "rent_index_index"
class Email_Rent_IndexController extends Mage_Core_Controller_Front_Action
{
public function IndexAction() {
$this->loadLayout();
$this->renderLayout();
//echo 'test index';
}
public function saveAction()
{
//getrequest->getpost is same as $_request/$_get/$_post function
// get data from afficher.phtml same as View
$name = ''.$this->getRequest()->getPost('name'); //textfield nom
$email = ''.$this->getRequest()->getPost('email'); //textfield prenom
$telephone = ''.$this->getRequest()->getPost('telephone'); //textfield telephone
//if all textfield is been filled
if(isset($name)&&($name!='') && isset($email)&&($email!='') && isset($telephone)&&($telephone!=''))
{
//save data/insert sql
$contact = Mage::getModel('test/test');
$contact->setData('name', $name);
$contact->setData('email', $email);
$contact->setData('telephone', $telephone);
$contact->save();
}
//on redirige l’utilisateur vers la méthode index du controller indexController
//de notre module <strong>test</strong>
$this->_redirect('index.php/test');
}
}
Bunu zaten kontrol cihazına yerleştirdim. ancak ana konteyner görünmez. http://strollerworld.optimastg.com/index.php/rent/ –
Denetleyici kodunuzu – chanz
'un üzerine ekleyebilir misiniz? Denetleyicimle ilgili bir sorun olmadığını düşünüyorum. –