Hello!
I have followed http://docs.cs-cart.com/docs-controllers and feel I have a good understanding of Controller->View function in CSCart, but I just can't get this particular scenario to work for me.
I'm trying to setup an admin page that will allow the user to perform tasks. I have folders/files setup correctly and I have verified that my controller is being called and my 'manage' mode is being executed, but still no view. I just get a 404 Page not Found.
Attempting to access page at:
/store_admin.php?dispatch=test_controller.manage
My view is located in:
/admin/addons/test_addon/views/test_controller/manage.tpl
Any ideas? Is there some place where the view needs to be registered? Do I have to manually display the view from the controller (CSCart docs says it should be called by convention)?
Doesn't [color=#282828][font=arial, verdana, tahoma, sans-serif]/store_admin.php?dispatch=test_controller.manage call a controller named test_controller with mode = 'manage'?[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]So you would need a controller/backend/test_controller.php[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]I'm a noob at this so sorry if I am wrong.[/font][/color]
If you want the view for backend test_controller.manage, the template should be installed as
design/backend/templates/addons/test_controller/views/test_controller/manage.tpl
Hi,
For creating new controller we recomend to use addon functionallity. So please create the following files with code:
- app/addons/my_changes/controllers/backend/test_controller.php
<br />
<br />
<?php<br />
<br />
if (!defined('BOOTSTRAP')) { die('Access denied'); }<br />
<br />
<br />
if ($mode == 'manage') {<br />
// some code...<br />
}<br />
```<br />
<br />
2. design/backend/templates/addons/my_changes/views/test_controller/manage.tpl```php
<br />
<br />
{* Some code *}<br />
<br />
```<br />
<br />
3. Then install "My changes" addon and clear cache <img src="upload://b6iczyK1ETUUqRUc4PAkX83GF2O.gif" class="bbc_emoticon" alt=":-)"><br />
<br />
Best regards,<br />
WSA team
Wow, the question was posted on 01 November 2013