Empty module and/or action after parsing the URL - symfony-1.4

i changed my onlinesite,in online server,i created new module in schema.yml files.but the above error was comming.i remove catch file content.after that same error was comming.
Empty module and/or action after parsing the URL "/Planbook/planbook_new" (/)
#planbook
planbook:
url: /planbook
param: { module: planbook, action: index }
most_recent:
url: /planbook/most_recent
param: { module: planbook,action: mostrecent }
planbook_view:
url: /planbook/planbook_view
param: { module:planbook,action: view }
plan_new:
url: /planbook/plan_new
param: { module: planbook,action: new }
planbook_edit:
url: /planbook/planbook_edit
param: { module: planbook, action: edit }
highly_recommended:
url: /planbook/highly_recommended
param: { module: planbook,action: recommended }
mytrack:
url: /mytrack
param :{ module: planbook,action: mytrack }
plan_mate:
url: /planbook/plan_mate
param: { module: planbook, action: plan_mate }
#layer
layer:
url: /layer
param: { module: layer, action: index }
layer_new:
url: /layer/new
param: { module: layer, action: new }
layer_edit:
url: /layer/edit
param: { module: layer, action: edit }
layer_delete:
url: /layer/delete
param: { module: layer, action: delete }
layer_view:
url: /layer/view
param: { module: layer, action: view }
<a href="<?php echo url_for('/Planbook/planbook_new') ?>"
<a href="<?php echo url_for("#planbook_new") ?>"
hi plz help me.

Few things you must keep in mind
Make sure there are no cache files by using symfony cc or you can manually delete the contents of cache folder.
Make sure the database connection is configured properly in databases.yml as the login page may not require to be connected with database which is not the case regarding other pages.
Make sure that the rewrite_module has been enabled (I hope you are using wamp which makes it simple to enable it)
Make sure that cache and log folders have write permission (I don't think it will be an issue in a Windows machine)
You may also consider going through http://www.symfony-project.org/gentle-introduction/1_4/en/05-Configuring-Symfony
Thanks

Few things to perform:
check you error log
use your dev controller (something like frontend_dev.php) to see errors
and show us the error.
I don't think it's related to htaccess since you can display the login page.

Related

Absolute path in Vue.js

I'm working in a vue file inside of a Symfony project and I want to find the absolute path from a route. Usually I do something like this:
this.$http({
url: 'products/edit/'+product.id,
method: 'PUT',
params : params
[...]
and it works great. But now I don't need to use this.$http because I'm trying to do this:
<div>
{{ getUrl(product) }}
</div>
and I have my function:
getUrl(product) : {
let url = '/products/edit'+product.id
return url
}
but obviously it only displays /products/edit/xxx
instead of mysite.com/products/edit/xxx in production or localhost/products/edit/xxx in local.
In my routing file I have:
update_product:
path: /products/edit/{product}
defaults: { _controller: RBProductsBundle:Product:edit }
Try this:
methods:
getFullUrl (product) {
return location.origin + this.getUrl(product)
}
}
...
{{ getFullUrl(product) }}
...
Location object has info about the origin & path to the currently opened page.
Read more about "location" here

Symfony 1.4 - Changing Code With FTP

I am currently editing the code of my Symfony 1.4 Website using Sublime Text and pushing it to the web server with an FTP client.
However I have added a new module called 'about' and added the template and actions folders with the relevant files but when i try to go to mysite /about it just redirects me to another page.
I have the Routing.YML setup as follows
homepage:
url: /
param: { module: home, action: index }
about:
url: /about
param: { module: home, action: about }
stats:
url: /footballfans/stats
param: { module: footballfans, action: stats }
dailytips:
url: /dailytips/index
param: { module: dailytips, action: index }
footballnews:
url: /footballfeed.:sf_format
param: { module: footballfans, action: atom, sf_format: atom }
requirements:
sf_format: (?:atom)
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
Is there any reason why these changes aren't being pushed to the site? Or do I have to edit a different file as well?
When I edit the template files these changes are being shown in the live site...
When I edit the VIEW.YML file to change the website SEO settings these also aren't being updated...

Using Meteor, useraccounts-core ensureSignedIn plugin won't except '/' route

I am trying to use the ensureSignedIn plugin on all routes except for a front 'home' page that has buttons to login to separate parts of the site.
Here's my route for 'home':
Router.route('/', function () {
this.render('home');
});
Here's the line for the plugin and exceptions:
Router.plugin('ensureSignedIn', {
except: ['home', 'atSignIn', 'atSignUp', 'atForgotPassword']
});
Both snippets are from my lib/routes.js file, if that makes a difference.
I've tried adding different route names in the except: portion, and they get correctly excepted, but I can't for the life of me get the 'home' route to not show "Must be logged in".
I've googled and read through gitHub issues and haven't seen anyone else with this problem, so it's probably something I'm doing wrong and not a bug with useraccounts or iron-router.
Set the name of the / route to root, then add that route name to the ensureSignedIn settings:
Router.route('/', {
name: 'root',
template: 'home',
action: function() {
this.render();
}
});
Router.plugin('ensureSignedIn', {
except: ['root', 'atSignIn', 'atSignUp', 'atForgotPassword', 'atResetPwd']
});

How to return 404 using Iron Router

When I hit a route that doesn't exist on my Meteor app that uses IR, I get a 200 response with an HTML that (when rendered on a browser) displays a js error on console saying that No route found for path: "/aRoute".
How can a make it return 404?
There don't seem to be a correct (or even working?) way of handling real 404's right now. See this issue for example: https://github.com/EventedMind/iron-router/issues/1055
Even when you try ways which should work, you'll still end up with a 200 status code. Like this code below which should work:
this.route( 'pageNotFound', {
path: '/(.*)',
where: 'server',
action: function() {
this.response.writeHead(404);
this.response.end( html );
}
});
I find this much easier way to show page not found. In router.js
Router.configure({
layoutTemplate: "layout",
loadingTemplate: "loading",
notFoundTemplate: "notFound"
})
Here "notFound" could be any template where you want to show 404 error
this.route('template404', {
path: '/*'
}
Use it at the end of your Router.map, cause this catches every value - if you use at the begining every path will be caught to this
Of course you can make it more complex, for example:
this.route('template404', {
path: '/posts/*'
}

ASP.NET Route config for Backbone Routes with PushState

I have run into an issue recently where we have been told to remove the hash symbols from our Backbone applications. This presents two problems: (a) the ASP.NET routes need to handle any remotely linked URL (currently this is no problem with the hash symbols) so that we're not hitting a 404 error and (b) the proper route needs to be preserved and passed on to the client side (Backbone) application. We're currently using ASP.NET MVC5 and Web API 2 for our backend.
The setup
For an example (and test project), I've created a test project with Backbone - a simple C# ASP.NET MVC5 Web Application. It is pretty simple (here is a copy of the index.cshtml file, please ignore what is commented out as they'll be explained next):
<script type="text/javascript">
$(document).ready(function(event) {
Backbone.history.start({
//pushState: true,
//root: "/Home/Index/"
});
var Route = Backbone.Router.extend({
routes: {
"test/:id": function (event) {
$(".row").html("Hello, " + event);
},
"help": function () {
alert("help!");
}
}
});
var appRouter = new Route();
//appRouter.navigate("/test/sometext", { trigger: true });
//appRouter.navigate("/help", { trigger: true });
});
</script>
<div class="jumbotron">
<h3>Backbone PushState Test</h3>
</div>
<div class="row"></div>
Now, without pushState enabled I have no issue remote linking to this route, ie http://localhost/Home/Index#test/sometext
The result of which is that the div with a class of .row is now "Hello, sometext".
The problem
Enabling pushState will allow us to replace that pesky # in the URL with a /, ie: http://localhost/Home/Index/test/sometext. We can use the Backbone method of router.navigate("url", true); (as well as other methods) to use adjust the URL manually. However, this does not solve the problem of remote linking. So, when trying to access http://localhost/Home/Index/test/sample you just end up with the typical 404.0 error served by IIS. so, I assume that it is handled in in the RouteConfig.cs file - inside, I add a "CatchAll" route:
routes.MapRoute(
name: "CatchAll",
url: "{*clientRoute}",
defaults: new { controller = "Home", action = "Index" }
);
I also uncomment out the pushState and root attributes in the Backbone.history.start(); method:
Backbone.history.start({
pushState: true,
root: "/Home/Index/"
});
var Route = Backbone.Router.extend({
routes: {
"test/:id": function (event) {
$(".row").html("Hello, " + event);
},
"help": function () {
alert("help!");
}
}
});
var appRouter = new Route();
//appRouter.navigate("/test/sometext", { trigger: true });
//appRouter.navigate("/help", { trigger: true });
This allows me to at least let get past the 404.0 page when linking to these routes - which is good. However, none of the routes actually "trigger" when I head to them. After attempting to debug them in Chrome, Firefox, and IE11 I notice that none of the events fire. However, if I manually navigate to them using appRouter.navigate("/help", { trigger: true }); the routes are caught and events fired.
I'm at a loss at this point as to where I should start troubleshooting next. I've placed my Javascript inside of the $(document).ready() event as well as the window.onload event also (as well as not inside of an event); none of these correct the issue. Can anyone offer advice on where to look next?
You simply have to move Backbone.history.start after the "new Route" line.
var Route = Backbone.Router.extend({
routes: {
"test/:id": function (event) {
$(".row").html("Hello, " + event);
},
"help": function () {
alert("help!");
}
}
});
var appRouter = new Route();
Backbone.history.start({
pushState: true,
root: "/Home/Index/"
});
Make sure you go to ".../Home/Index/help". If it doesn't work, try temporarily removing the root and go to ".../help" to see if the root is the problem.
If you still have troubles, set a js breakpoint in Backbone.History.loadUrl on the "return" line. It is called from the final line of History.start to execute the current browser url on page load. "this.matchRoot()" must pass then, "fragment" is matched against each "route" or regexp string in "this.handlers". You can see why or why not the browser url matches the route regexps.
To set to the js breakpoint, press F12 in the browser to open the dev console, press Ctrl-O or Ctrl-P to open a js file, then type the name of the backbone js file. Then search for "loadUrl:". You can also search for "Router =" to find the start of the router class definition (same as for "View =" and "Model =" to find the backbone view/model implementation code). I find it quite useful to look at the backbone code when I have a question like this. It is surprisingly readable and what better place to get answers?
If your js files happen to be minified/compressed, preferably turn this off. Alternately you can try the browser unminify option. In Chrome this is the "{}" button or "pretty print". Then the js code is not all on 1 line and you can set breakpoints. But the function and variable names may still be mangled.
I have solved my own problem using what feels to be "hackish", via the following. If anyone can submit a better response it would be appreciated!
My Solution:
I globally override the default Backbone.Router.intilaize method (it is empty) with the following:
$(document).ready(function (event) {
var _root = "/Home/Index/";
_.extend(Backbone.Router.prototype, {
initialize: function () {
/* check for route & navigate to it */
var pathName = window.location.pathname;
var route = pathName.split(_root)[1];
if (route != undefined && route != "") {
route = "/" + route;
this.navigate("", { trigger: false });
this.navigate(route, { trigger: true });
}
}
});
});

Resources