Results 1 to 6 of 6

Thread: Url Routing Joomla type

  1. #1
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Url Routing Joomla type

    can anyone tell me how url routing works and how to load a page as it done in joomla

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What do you mean? Can you give an example?

    Generally, domain names are sent to various levels of DNS (domain name servers) until the signal reaches the host. Then the request URI (basically URL) is parsed by the server and the right page is served.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    priya.mehta111 (04-23-2010)

  4. #3
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    hii and thank you so much for you interest
    Acutally i m trying to make cms in which i would like to load the components by spliting of url and then load the components like
    "index.php?option=com_content&view=section&id=4" split this url like

    option=com_contents,
    view=section
    id=4,


    it means actually the url have to load the main folder components and look for the folder content, and then look at the folder section, where it will get the code to publish my webpage content as it defined in section folders view.php;
    for this example the path what script need to follow is :

    joomladomain.com/components/com_content/views/section/view.html.php


    see this directory if you have joomla installed on your system

  5. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I think thats just using php includes or requires and conditional statements for the values. http://php.net/manual/en/function.include.php http://php.net/manual/en/function.require.php

    For example my page I have:

    PHP Code:
    <?php 
    $page_sub 
    $_GET['sec'];
    $page_on $_GET['id'];
    ?>
    <a href="?id=develop" <?php if ($page_on === "develop") { echo "id=\"page_on\"";}?>>Development</a>
    <a href="?id=fun" <?php if ($page_on === "fun") { echo "id=\"page_on\"";}?>>Chris Activities</a>
    <?php
    if ($page_on === "fun") {
    require(
    "fun.php");
    }
    if (
    $page_on === "develop") {
    require (
    "develop.php");
    }
    ?>
    domain structure:

    site.com/?id=fun or site.com/index.php?id=fun

    the section I have set up is used on my fun or develop section.
    Corrections to my coding/thoughts welcome.

  6. The Following User Says Thank You to bluewalrus For This Useful Post:

    priya.mehta111 (04-23-2010)

  7. #5
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post

    dear i m looking to resolve the url like index.php?option=vlaue&view=solution&id=12&type=reg

    like this can handle as many parameters pass to it, the content can be stored and can follow the the directory folder path which will be generate dynamically from the url or if the url is wrong or broken then it will redirect to an error page else redirect to the destination folder to load the content on the page, this is my actual problem what i want to solve.

  8. #6
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    You can do that with conditional ifs or switchs
    This is a simplish break down if the domain structure were like site.com/?page=1&user=123. This is not good coding...
    PHP Code:
    <?php
    if (isset($_GET['page'];) {
    $page_on $_GET['page'];
    if (
    $page_on == "1" ) {
    $page_on "home"
    }
    } else {
    $page_on "";
    }
    if (isset(
    $_GET['user'];) {
    $user $_GET['user'];
    }
    ?>
    <h1>Welcome to the Home Page 
    <?php 
    if ($user == "123") { 
    ?>
    John.</h1>
    <?php
    } else {
    ?>
    .<br /><span style="color:#ff0000;">Please login.</span></h1>
    }
    } else {
    ?>
    Error Page not found.
    <?php
    }?>
    Corrections to my coding/thoughts welcome.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •