{hotelName} ?

Results 1 to 3 of 3
  1. #1
    Member MarcusDEV is offline
    MemberRank
    Dec 2015 Join Date
    Skien, NorwayLocation
    51Posts

    {hotelName} ?

    Hey everyone.
    I was just wondring how Cryptos made it so if i type {hotelname} in my code, it will then write the hotelname from the config file.
    Is it possible to make my own? {custom}


  2. #2
    Hello there RetroPiggy is offline
    MemberRank
    Aug 2013 Join Date
    UKLocation
    288Posts

    Re: {hotelName} ?

    If you go to the 'app' folder and then open class.template.php, you can see all the available options.

    You will see at the top of the 'Initiate' function is $this->setParams('hotelName', $_CONFIG['hotel']['name']);

    the first paramter is what will be in the {}. In this case, it is 'hotelName'. The second parameter is the value. With hotelName, it pulls the name from the config file.

    You can easily create your own aswell. For exmaple, if you wanted to return the current Unix timestamp you could do:
    $this->setParams('timestamp', time());

    Then typing {timestamp} would return that timestamp

  3. #3
    Member MarcusDEV is offline
    MemberRank
    Dec 2015 Join Date
    Skien, NorwayLocation
    51Posts

    Re: {hotelName} ?

    Quote Originally Posted by RetroPiggy View Post
    If you go to the 'app' folder and then open class.template.php, you can see all the available options.

    You will see at the top of the 'Initiate' function is $this->setParams('hotelName', $_CONFIG['hotel']['name']);

    the first paramter is what will be in the {}. In this case, it is 'hotelName'. The second parameter is the value. With hotelName, it pulls the name from the config file.

    You can easily create your own aswell. For exmaple, if you wanted to return the current Unix timestamp you could do:
    $this->setParams('timestamp', time());

    Then typing {timestamp} would return that timestamp
    Thank you so much RetroPiggy!



Advertisement