php - Magento 404 page found and block is not getting called

915

I have created a custom module with 2 function in controller, one is for index page and another is for success page. I am able to access index page but when i enter success page in url it displays 404 found. I dont know where i have done the mistake.

My Module name is instagram..My controller code:

   app/code/local/Blazedream/Instagram/controllers/IndexController.php
   <?php

  class Blazedream_Instagram_IndexController extends Mage_Core_Controller_Front_Action
  {
 public function indexAction() {

    $this->loadLayout();
    $this->getLayout()->getBlock('login.instagram');

    //print_r($this->getLayout()->getBlock('footer.topvendors'));die;

    $this->renderLayout();


}
public function successAction() {
    echo "hello hello"; die;
    $this->loadLayout();
    $this->getLayout()->getBlock('login.success');

    //print_r($this->getLayout()->getBlock('footer.topvendors'));die;

    $this->renderLayout();


}
}

My config.xml file:

       app/code/local/Blazedream/Instagram/etc/config.xml
       <?xml version="1.0"?>
  <config>    
<modules>
    <Blazedream_Instagram>
        <version>1.6.2.0.4</version>
    </Blazedream_Instagram>
</modules>
 <frontend> 
    <routers> 
        <instagram> 
            <use>standard</use> 
            <args> 
                <module>Blazedream_Instagram</module> 
                <frontName>instagram</frontName> 
            </args> 
        </instagram> 
    </routers> 
    <layout> 
        <updates> 
            <instagram> 
                <file>instagram.xml</file> 
             </instagram> 
        </updates> 
    </layout> 
 </frontend>
 <global> 
    <blocks> 
        <instagram> 
            <class>Blazedream_Instagram_Block</class> 
       </instagram> 
    </blocks>
 </global> 
  </config>

My Loginblock file:

       app/code/local/Blazedream/Instagram/Block/Loginblock.php
      <?php 
 class Blazedream_Instagram_Block_Loginblock extends Mage_Core_Block_Template {

 public function loginblock() {
    $instagram = new Blazedream_Instagram_Block_Instagramclassblock(array(
        'apiKey' => 'cb513b66892b45bda10682dad0af12ff',
        'apiSecret' => 'e17241be433642f1af478fe06677a8f4',
        'apiCallback' => 'http://192.168.1.188/projects/shopu_v2/trunk/shopu/index.php/success' // Callback URL
    ));
    return $instagram;  

  }
 }

My success Block file:

         app/code/local/Blazedream/Instagram/Block/Loginblock/Success.php
        <?php
   class Blazedream_Instagram_Block_Loginblock_Success extends Mage_Core_Block_Template {

public function successblock() {
    $success = "success";
    return $success;    

}
}

My Layout file:

   app/design/frontend/mtquartz03/default/layout/instagram.xml
   <?xml version="1.0"?>
     <layout version="0.1.0">
    <default>
      <reference name="content">
      </reference>
  </default>
  <instagram_index_index>  
       <reference name="content">
             <block type="instagram/loginblock" name="login.instagram" template="instagramlogin/instagram.phtml"></block>
       </reference>
  </instagram_index_index>
  <instagram_index_success>  
       <reference name="content">
             <block type="instagram/loginblock_success" name="login.success" template="instagramlogin/success.phtml"></block>
       </reference>
  </instagram_index_success>
  </layout>

Then I have created my view file also...

My url to access the index funtion in controller:

       http://192.168.1.188/projects/shopu_v2/trunk/shopu/index.php/instagram

My url to access the success function in controller:

     http://192.168.1.188/projects/shopu_v2/trunk/shopu/index.php/instagram/success

Can anyone help me to guide where i have done the mistake. Thanks in advance.

People are also looking for solutions to the problem: php - Is it possible to use a column from another join to create a condition in another join mysql

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.