The url class in layman terms, is a common "passthru" point that ALL links went through. Initially it was used to allow automatic manipulation of the the url to:
- fallback https to http if not on a secure server
- swap "&" with "&" before encoding.
This was only the tip of the iceberg, as the class would also allow:
- Customized SEO design of ALL urls
- Implementation of a Token system with only a few changed lines of code
- handling of customized GET vars with a few lines of code
Despite our constant requests to have this added back into the core, it seems it is still not wanted by Daniel.
But the rest of us see great value in adding it back in and would like to know if things like customized SEO is something you would like to see in future versions? If so then this would need to be added back in.
Most other frameworks I've seen offer a common url class:
PrestaShop has the "link.php class"
CodeIgniter has an "Anchor class"
Drupal has their "url class"
Wordpress has a the "esc_url" method
CakePHP has the link htmlhelper
Almost every big name framework or script has one. I don't understand why we shouldn't.
Back to the topic, I'm curious, how are URLs handled at this time? Are they ran through htmlspecialchars, or just left as-is? A single class to handle all URLs makes sense to me.
Old way:
Controller:
Code: Select all
$this->data['href'] = $this->url->http('common/home'); // This url class cleaned up the url
Code: Select all
<a href="<?php echo $href; ?>">
Current way:
Controller:
Code: Select all
$this->data['href'] = HTTP_SERVER . 'index.php?route=common/home'; //No class. Just raw
Code: Select all
<a href=<?php echo str_replace('&', '&', $href); ?>">
I would be interested to hear Daniel's rationale as to why it shouldn't be adopted/restored.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
http://forum.opencart.com/viewtopic.php ... 906#p58593mystifier wrote:I voted yes, but I am very easily seduced. It seems to make very good sense.
I would be interested to hear Daniel's rationale as to why it shouldn't be adopted/restored.
Request Reviews v1.0 released.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
yeah Daniel probably slipped in here and voted no lol.Qphoria wrote:Looks like there was 1 vote for NO...
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Ban!Qphoria wrote:Looks like there was 1 vote for NO...
btw. it wasn't me
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
whats wrong with
HTTP_SERVER . 'index.php?route=common/home';
compared to:
$this->url->http('common/home');
yes its shorter but what about creating url's in emails when using multi-stores.
$order_info['store_url'] . 'index.php?route=common/home';
I should have done it like this:
$this->config->get('config_url') . 'index.php?route=common/home';
and:
$this->config->get('config_ssl') . 'index.php?route=common/home';
secondly if you did use it to rewrite urls then you have to include a db class in a url class. I don;t like doing this because I prefer to keeep everything seperate and keep things more flexable.
OpenCart®
Project Owner & Developer.
The pain that it was to manually add the token to all 1052 areas in the admin code should be reason enough to prove that the class is needed. With the url class, we could have added a token with a 3 lines of code in the url and the request classes. And there would be no db class needed there. And developers would not have had to edit their code to add token support as it would be automatic.
With the url class, all urls could be formatted in cleaner links by default without even added the seo keyword/url alias
Code: Select all
http://www.site.com/index.php?route=product/product&product_id=50
Code: Select all
http://www.site.com/product/product/product_id/50
Code: Select all
http://www.site.com/mens-hats/nike-blue-large-hat.html
By leaving it out now, we can't even make a mod to improve it without editing 1052 lines of code... and thats just the admin side. Haven't even checked the catalog side. This just makes opencart unfriendly to developers and that is a step backwards. Whether you think it is needed or not, all other developers who use the cart think it is needed, and they are the ones using it.
We spend too much time as developers with this tedious BS when it could be done so much simpler and give people greater control to create their own url SEO structures.
Has Daniel made up his mind and agreed to return to this URL Class?
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Qphoria wrote:Lol try reading the last 2 posts noob!i2Paq wrote:What is the current situation on this?
Has Daniel made up his mind and agreed to return to this URL Class?
I totally overlooked Daniels post *puts classes on*
Hmm, what a shame....
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
OpenCart®
Project Owner & Developer.
Users browsing this forum: KhubaibKhan and 297 guests