-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting an error template #5
Comments
I don't think I can figure out what caused the error to occur.. But I can point out a few things that might help. If you want all your templates to be in Smarty, than you have to write your 404.tpl in smarty syntax as well. I'm assuming you just copied 404.phtml from zendskeleton to 404.tpl, which means smarty will just output it's content as html. Also you don't need to explicitly say you want to use the smartyViewStrategy as strategy in every module you're using. This is already done when you add 'MaxnufSmarty' to application.config.php hope this helps. |
Hi, I was able to get the error messages displayed in the 404.tpl. Here is the 404 error page: A 404 error occurred Controller: resolves to invalid controller class or alias: Application\Controller\Application ; Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Application\Controller\Application #0 D:\xampp\php\custom_libs\Zend\ServiceManager\AbstractPluginManager.php(110): Zend\ServiceManager\ServiceManager->get('Application\Con...', false) Below is IndexController.php if it would be of any help: |
good that you got the error page working. Looking at the provided error, it seems you have done something wrong in your module/Application/config/module.config.php file so either, you did something wrong with your route, or with the alias 'Application\Controller\Application', or you simply just need to create the ApplicationController.php file Are you using the skeleton application? https://github.com/zendframework/ZendSkeletonApplication what you should have is something like:
But since it can't find 'Application', it seems you have your route point to 'Application' while it should point to 'Index', or something. I don't think your issue is related to smarty. |
Hi ,
First of all thank you for this module, have been searching all week for smarty to zf2 integration and this module comes very close to completing my task. Its just that I am getting a 404 page template instead of the index template and have no idea why. Here is the page that i get:
A 404 error occurred
message ?>
reason) && $this->reason): ?> reason) { case 'error-controller-cannot-dispatch': $reasonMessage = 'The requested controller was unable to dispatch the request.'; break; case 'error-controller-not-found': $reasonMessage = 'The requested controller could not be mapped to an existing controller class.'; break; case 'error-controller-invalid': $reasonMessage = 'The requested controller was not dispatchable.'; break; case 'error-router-no-match': $reasonMessage = 'The requested URL could not be matched by routing.'; break; default: $reasonMessage = 'We cannot determine at this time why a 404 was generated.'; break; } ?>
controller) && $this->controller): ?>
Controller:
escape($this->controller) ?> controller_class) && $this->controller_class && $this->controller_class != $this->controller ) { echo " (resolves to " . $this->escape($this->controller_class) . ")"; } ?> exception) && $this->exception): ?>
Exception:
escape($this->exception->getMessage()) ?>
Stack trace
exception->getTraceAsString() ?>
....and below is the 404 template code:
A 404 error occurred
message ?>
reason) && $this->reason): ?> reason) { case 'error-controller-cannot-dispatch': $reasonMessage = 'The requested controller was unable to dispatch the request.'; break; case 'error-controller-not-found': $reasonMessage = 'The requested controller could not be mapped to an existing controller class.'; break; case 'error-controller-invalid': $reasonMessage = 'The requested controller was not dispatchable.'; break; case 'error-router-no-match': $reasonMessage = 'The requested URL could not be matched by routing.'; break; default: $reasonMessage = 'We cannot determine at this time why a 404 was generated.'; break; } ?> controller) && $this->controller): ?>Exception:
escape($this->exception->getMessage()) ?>
Stack trace
...and my view manager part in module.config.php
.................
'view_manager' => array(
'strategies' => array(
'SmartyViewStrategy'
),
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => DIR . '/../view/layout/layout.tpl',
'application/index/index' => DIR . '/../view/application/index/index.tpl',
'error/404' => DIR . '/../view/error/404.tpl',
'error/index' => DIR . '/../view/error/index.tpl',
),
'template_path_stack' => array(
'application' => DIR . '/../view',
),
),
..................
Thank you,
Levy
The text was updated successfully, but these errors were encountered: