• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternate URI syntax

#21
[eluser]freshface[/eluser]
var_dump shows me bool(false)


My CI setup: http://www.freshface.be/orange.zip

#22
[eluser]TheFuzzy0ne[/eluser]
OK, I'm using this test controller:

Code:
<?php

class Aseg_test extends Controller
{
    function test()
    {
        var_dump($this->uri->asegment('keyword'));
    }
}

When I go to this URL:

http://localhost/aseg_test/test/keyword:test

This is the output:
Code:
string(4) "test"

I'm wondering if there's a problem with your uri_protocol or something else along those lines. I'd suggest you try each of the different protocols listed in the config.php file, and see if that helps at all.

#23
[eluser]freshface[/eluser]
Just tested them all, som gave a 404 others gave bool(false)

#24
[eluser]freshface[/eluser]
It works!
I loaded a wrong class in autoload and it messed up everything. Dont know why php didn't throw an error, but it works.

#25
[eluser]TheFuzzy0ne[/eluser]
Glad you got it sorted. If this is your development server, I'd suggest that you ensure that at the top of index.php you have error_reporting(E_ALL). That should alert you as to just about every single error and warning encountered. I think it comes set to that by default, but I can't remember.

#26
[eluser]quasiperfect[/eluser]
i tried to use this with ci svn but it doesen't work
i tried a var_dump($this->uri->asegment('keyword')); and it returns flase
i tried a print_r($this->asegments); inside the function asegment and the array si always empty
i tried a print_r($this->asegments); inside the function _reindex_segments() and the array is ok

any ideea ?

#27
[eluser]TheFuzzy0ne[/eluser]
Have you tried the different URI protocols?

#28
[eluser]quasiperfect[/eluser]
if global_xss_filtering is activated the lib dosen't work. i wanted to use the lib but i need global_xss_filtering more because i have lot's of forms

#29
[eluser]TheFuzzy0ne[/eluser]
Why not use the post method for your forms? My library only works with the URI, and also, it's only intended to be used in a few controllers; not as a replacement for query strings. If you need this kind of flexibility for all of your controllers, you should consider using query strings.

#30
[eluser]RS71[/eluser]
Interesting solution.

Could you possibly implement a way to pass arrays in the URL as well?

Something like:

/color:red,green,blue/ or /color:red-green-blue/

Thanks mate


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.