Yii Framework Forum: catchAllRequest - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

catchAllRequest

#1 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 07 October 2011 - 10:43 AM

I think it should be improved to support anonymous functions... :rolleyes:
Cause to make it work with sessions you really need to write ugly code with ternary operators ...

maintenance task is a very basic, thus it should be more elegant and not like hacking :)
0

#2 User is offline   lubosdz 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 115
  • Joined: 25-July 10
  • Location:Slovakia, Bratislava

Posted 08 October 2011 - 11:04 AM

View Postdckurushin, on 07 October 2011 - 10:43 AM, said:

I think it should be improved to support anonymous functions... :rolleyes:
Cause to make it work with sessions you really need to write ugly code with ternary operators ...

maintenance task is a very basic, thus it should be more elegant and not like hacking :)


Could you provide some example what exactly you mean?

There is a built-in method called "missingAction".

http://www.yiiframew...ngAction-detail

This method will handle all HTTP request without defined action. You can write whatever you want inside function. How would you improve it?

Lubos
Yii extension: Captcha Extended

Greatest discoveries in 22nd century will be about the gravitation. | http://www.synet.sk | http://ipdf.sk
0

#3 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 09 October 2011 - 09:20 AM

catchAllRequest in yii if it is not set to null, catch all requests and do something...

http://www.yiiframew...catchAllRequest


this is useful for creating maintenance for example...
but it is not that flexible... and you can work with it only with ternary operators...

$_SERVER['MAINTENANCE'] ? ... : null

... =

session_start() && isset($_SESSION['adminSession']) ? null : site/maintenance

etc.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users