$blog->getURL() does not return complete url

Before saving the blog, I want to process the and store the blog url. However, it misses a number from it e.g.:

$blog->getURL() returns:

http://localhost/blog/view/<missing number>/somequery

instead of:

http://localhost/blog/view/101/somequery

 

How can I get the correct url?

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking