Issue
Forgive me, I am still super new to cakephp. There are many things I haven't done yet. Migrating a baked aspects of my dev site to my live site is one of them. I followed a tutorial to add tags to my website. Cake Tags Tut Everything on the dev site works perfect. Today I tried to move everything to the live site. I know its not the proper way to do it but I made a list of the changes I made and then moved the files and made the changes on the website. When I go to the URLs I need to use the tags I get an error. I have routes set up for the URLs and everything. Even though on the dev site I don't even need the routes for the URLs to work. Which makes me wonder about the baking process. After I gave the dev site the bake command the URLS were just there, it created all the skeleton code for the URL localhost/tags/add to work and I was able to start creating tags. Funny thing, all the functionality on the live site is there. When I create a post I can add tags to the DB and they pull fine when editing the post, they even show on the views. The only thing, I cant get to work are the index.ctp, add.ctp and edit.ctp for the tags. If you need any more info please just ask and I will provide it.
Route to define url for tags:
$routes->connect('/tags', ['controller' => 'Tags', 'action' => 'index']);
UPDATE:
I briefly turned on debug mode on the live site. Reloaded the page and got and error that has a bit more info.
Error: The layout file Admin/Layout/Admin.ctp can not be found or does not exist.
Confirm you have created the file: Admin/Layout/Admin.ctp in one of the following paths: /home/nerej/public_html/src/Template/Admin/Layout/Admin.ctp
Hmmm, funny. In my dev site I was also having a similar issue.
Solution
OK, basically a naming convention error. The new error helped me track it down.
I was calling this in my funciton in TagsController:
$this->viewBuilder()->layout('Admin');
But needed this:
$this->viewBuilder()->layout('admin');
Answered By - Corey Woods
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.