Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Suggestion of more clear explanation of Phalcon\Mvc\Url::get() #432

Closed
Conradaek opened this issue Aug 17, 2014 · 2 comments
Closed

Suggestion of more clear explanation of Phalcon\Mvc\Url::get() #432

Conradaek opened this issue Aug 17, 2014 · 2 comments

Comments

@Conradaek
Copy link

Current version of example code at http://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Url.html is not enough.

I suggest to change it for:

<?php

//Generate a URL appending the URI to the base URI
echo $url->get('products/edit/1');

//Generate a URL for a predefined route
echo $url->get(array(
    'for' => 'blog-post',
    'title' => 'some-cool-stuff',
    'year' => '2012',
));

//generates e.g. /show/products?id=1&name=Carrots
echo $url->get('/show/products', array('id' => 1, 'name' => 'Carrots'));

Added 3rd example is taken from http://forum.phalconphp.com/discussion/627/phalcon-mvc-url-get-append-query-params-examples

Also the code provided by me should be modified in order to explain the last parameter of get() method. I mean 3rd argument which is $locale.

I asked a question on Phosphorum here http://forum.phalconphp.com/discussion/3153/what-s-last-argument-in-phalcon-mvc-url-get-for- and I will update the proposed code when sb will answer me.

@Conradaek Conradaek changed the title More clear explanation of Phalcon\Mvc\Url::get() Suggestion of more clear explanation of Phalcon\Mvc\Url::get() Aug 17, 2014
@unisys12
Copy link
Contributor

Looks as though the reference code you are referring to is located in the API section of the docs. This area is auto-generated by doc-block comments in the C code. For example, your link above points to code examples generated from here.

On that note though... If you look closely at the doc-block, on line 276 and read through it, you will notice that the third param is not there. Searching the whole document does not reveal a third param for $local. Which by the way, refers to weather it is a local path or not, so that answers one of your concerns.

@xboston, have you seen this before? Doc-Blocks not matching with the generated API reference? Would love your input, because this is beyond my field of experience.

@SidRoberts
Copy link
Contributor

I've added a PR to the main Phalcon repo. You can follow its status at phalcon/cphalcon#11047.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants