|
|
Subject: Re: expiration date page (was- Fwd: Hello Sir) - msg#00377
List: CakePHP
I;m not really sure about the exact mechanics you'd like, but you can
probably set the view so that it changes according to the date:
<?php
if (date("Y-m-d") < date("2010-12-27") ) {
//Display Christmas inforamtion
} elseif (//Whatever) {
//Display other timedependant views
}
Perhaps you can use different elements (That you place in views/
elements and name accordinginly) that you load here, and tell the
controller which one to load:
In controller
if (date("Y-m-d") < date("2010-12-27") ) {
$this->set('layout', "christmas");
} elseif ((date("Y-m-d") < date("2010-08-01") && (date("Y-m-d") >
date("2010-06-01"))) {
$this->set('layout', "summer");
}
and then in the view:
echo $this->renderElement($layout);
Just two ideas from the top of my head.
On 9 feb, 05:23, Marcelo Andrade <mfandr...@xxxxxxxxx> wrote:
> ---------- Forwarded message ----------
> From: r sai lingeswara reddy <sai.cool....@xxxxxxxxx>
> Date: Mon, Feb 8, 2010 at 1:31 PM
> Subject: Hello Sir
>
> Hello Sir,
> How are you?
> I have a doubt regarding the php(I'm using cakephp framework). What I
> need to do is...I have to set the expiration date a certain page. For
> example.
> I am creating a christmas party page.
> 1) I need to first set the user login page
> 2) then redirect it to the main party page
> 3) And I need to close the page on a particular date
> for example:- the party page shud be available on from dec 1st 2010
> to dec 27th 2010
> How do i do it sir? Can u guide me..Do I have to make use
> of session--put ---get?? Do u have any examples that I can go
> through...Thank u in advance...have a nice day
>
> Looking forward to ur reply...
>
> Sincerely,
> Sai
>
> --
> MARCELO F ANDRADE
> Belem, Amazonia, Brazil
>
> "I took the red pill"
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: Auth flash message LAYOUT ???
Try something along these lines:
$this->Session->setFlash
(__
('Message.', true),
true,
array('class' => 'flashError')
);
Jeremy Burns
jeremyburns@xxxxxx
On 9 Feb 2010, at 14:32, tokasaa@xxxxxxxxx wrote:
> Hi, I am trying to set a custom layout for Auth flash message.
> setFlast() support that but it seems to be hardcoded in the core for
> case of auth messages.
>
>
> any idea how to set my own layout wrapper around this message ...
>
> "Login failed. Invalid username or password." ???
>
> thanks
> help appreciated.
> Tomas
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Next Message by Date:
click to view message preview
Re: validation of serialized data
Thanks, I will not use serialized data for this. All of my current
contact models use the BelongsTo - HasMany approach and this project
will also. I had just finished coding a metadata interactor and used
serialized data with great success but I see it does not fit for this
type of relationship. The current project is a conversion where the
previous db has 4 fields for emails and 4 fields for phones. Guess
I'll finally have to write my record status behavior.
Gary
2010/2/9 Dérico Filho <uldericofilho@xxxxxxxxx>:
> Unless you really know what you are doing, you should avoid storing
> canonical data in serialized strings.
>
> Though it has been done with very great results off the cakephp world.
>
> See how it is done at FriendFeeder:
> http://bret.appspot.com/entry/how-friendfeed-uses-mysql
>
> Serialized data used as a denormalized data store.
>
> On Feb 8, 6:12 pm, bujanga <buja...@xxxxxxxxx> wrote:
>> Just some thinking and a question or two, please tell me if I am
>> totally off base.
>>
>> I would like to store multiple email addresses and phone numbers per
>> user. Using a serialized field might work for this. Is that a good
>> usage?
>>
>> Next, how does one validate the data and properly save and find the
>> data. Here is what I am thinking (not tested).
>>
>> Validate the Model using a custom validation function:
>>
>> var $validate = array(
>> 'emails' => array(
>> 'is_email' => array(
>> 'rule' => array('g_isEmail'),
>> 'required' => TRUE,
>> 'allowEmpty' => FALSE,
>> 'message' => 'You must enter at least 1 valid email
>> address'
>> ),
>> ),
>> )
>>
>> function g_isEmail($check){
>> if ( !isset($this->data['Model']['emails']) ){
>> return FALSE;
>> }
>> if ( is_array($this->data['Model']['emails']) ){
>> foreach( $this->data['Model']['emails'] as $email ){
>> if ( !Validate::email($email) )
>> return FALSE;
>> }
>> }
>> }elseif( !Validate::email($this->data['Model']['emails']) )
>> return FALSE;
>> }
>> return TRUE;
>>
>> }
>>
>> Then using beforeSave to serialize the field and afterFind to
>> unserialize the field.
>>
>> Thanks,
>>
>> Gary Dalton
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Previous Message by Thread:
click to view message preview
expiration date page (was- Fwd: Hello Sir)
---------- Forwarded message ----------
From: r sai lingeswara reddy <sai.cool.guy@xxxxxxxxx>
Date: Mon, Feb 8, 2010 at 1:31 PM
Subject: Hello Sir
Hello Sir,
How are you?
I have a doubt regarding the php(I'm using cakephp framework). What I
need to do is...I have to set the expiration date a certain page. For
example.
I am creating a christmas party page.
1) I need to first set the user login page
2) then redirect it to the main party page
3) And I need to close the page on a particular date
for example:- the party page shud be available on from dec 1st 2010
to dec 27th 2010
How do i do it sir? Can u guide me..Do I have to make use
of session--put ---get?? Do u have any examples that I can go
through...Thank u in advance...have a nice day
Looking forward to ur reply...
Sincerely,
Sai
--
MARCELO F ANDRADE
Belem, Amazonia, Brazil
"I took the red pill"
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Next Message by Thread:
click to view message preview
Configue::lisObjects(,,) ; Seems doesnt work????
look at this code snipest :
$controllers = Configure::listObjects('controller');
$plugins = Configure::listObjects('plugin');
if (!empty($plugins)) {
foreach ($plugins as $plugin) {
$pPath= APP . 'plugins' . DS. $plugin . DS .
'controllers' . DS;
$pluginControllers =
Configure::listObjects('controller',
$pPath ,false);
if (!empty($plugincontrollers)) {
foreach ($pluginControllers as
$controller) {
$models[] =
"$plugin.$controller";
}
}
}
}
return $controllers;
i want to retreive every controller in my app even the plugins
controller and in 1.2.X i can do it easily with the Configure class
and it's listObjects method like in this snipest but it doesnt work
with plugins controllers and as you see i think that the path is
correct for every plugin but it returns nothing if you see where i am
wrong please help or test the code to check if the $path varible works
well in the core of cake.
nb: the result is great for app/controllers.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
|
|