0

my controller is

  public function loadprojectAction()
{
    $this->layout ( 'layout/layoutin' );
    $id = (int) $this->params()->fromRoute('id', 0);
    echo $id;
    if (!$id) {
        return $this->redirect()->toRoute('album', array(
                'action' => 'add'
        ));
    }
    //$album = $this->getAlbumTable()->getAlbum($id);
    // This shows the :controller and :action parameters in default route
    // are working when you browse to /project/project/foo
    return array();
}

and my route is.

          'routes' => array (
                    'project' => array (
                            'type' => 'segment',
                            'options' => array (
                                    'route' => '/project[/:action][/:id]',
                                    'constraints' => array (
                                            'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                            'id' => '[0-9]+'

                                    ),
                                    'defaults' => array (
                                            'controller' => 'Project\Controller\Project',
                                            'action' => 'index' 
                                    ) 
                            ),
                    ) 
            )

the layout wont show the images and any other thing only the body of the layout. but it will load the imagetitle.

  • `echo $id;` inside the controller makes no sense. May solve your problem already - kinda hard to tell, don't quite understand the problem. – Sam Jun 03 '14 at 12:45
  • nope i by using echo i just wanted to check whether there is a id or not.. actually it like my layout body tag is loading but stylesheets are not loading... –  Jun 03 '14 at 12:56
  • So you have a `layout/layoutin` defined in the config file or is it `layout/layout`? If yes then please check that file. – Kunal Dethe Jun 03 '14 at 13:44
  • yeah its working properly in all the action except this action –  Jun 03 '14 at 17:46
  • This is more likely to be a problem with the stylesheet paths in the layout itself. Can you provide an example of how you are including in your layout one that isn't loading? – Tim Fountain Jun 04 '14 at 01:47

0 Answers0