1

Please some one dont close this as duplicate, no answers fixing my issue:

Im trying to create a new page in which login and register come together and will have custom fields.

Below is the my folder structure:

app
    - code
        - local
            - Php
                - Customer
                    - etc
                    - controllers
                    - Model

app
    - design
        - frontend
            - default
                - php
                    - layout
                    - template

Below is the module config file:

app/code/local/php/Customer/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Php_Customer>
            <version>0.1.0</version>
        </Php_Customer>
    </modules>
    <frontend>
        <routers>
            <customer>
                <use>standard</use>
                <args>
                    <modules>
                        <php_customer before="Mage_Customer">Php_Customer</php_customer>
                    </modules>
                </args>
            </customer>
        </routers>
        <layout>
            <updates>
                <customer module="Php_Customer">
                    <file>php_customer.xml</file>
                </customer>
            </updates>
        </layout>
    </frontend>
</config>

Below is account controller:

app/code/local/php/Customer/controllers/AccountController.php

<?php

require_once 'Mage/Customer/controllers/AccountController.php';
class Php_Customer_AccountController extends Mage_Customer_AccountController
{
    public function loginAction(){
        die('Php Overriden');
        $this->loadLayout();
        $this->renderLayout();
    } 
}

Below is the layout config:

app/design/frontend/base/default/layout/php_customer.xml

<?xml version="1.0"?>
<layout>
    <php_customer_account_login>
        <reference name="content">
            <block type="module/ablock" name="login" template="popup_login.phtml" />
        </reference>
    </php_customer_account_login>
</layout>

below is the template file:

app/design/frontend/base/default/template/popup_login.phtml

<p>HTML Rendered Successfully</p>

When I echo something in the controller its printing on the screen, So I understood module added. but the phtml file is not rendering.

Below is exception log file:

exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Php_Customer_Block_Login' in D:\wamp\www\promo\app\Mage.php:595

No error log captured.

  • check the error log and past it too – Qaisar Satti Jun 3 '15 at 11:53
2
<block type="module/ablock" name="login" template="popup_login.phtml" />

change it

<block type="core/template" name="login" template="popup_login.phtml" />

if it is working. then create your block.

  • whats the difference between these two? – Butterfly Jun 3 '15 at 12:01
  • 1
    this is a big difference. this is core core/template block. other will be created by you. and i think you don't create the block and extend from that block. – Qaisar Satti Jun 3 '15 at 12:02
  • yes I haven't created any Php/Customer/Block Its working after changing module/ablock to core/template – Butterfly Jun 3 '15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.