Miles J | 1 Aug 01:04 2009
Picon

Re: Calling component in helpers / Calling models in helpers


startup(), initialize() and any callbacks, are NOT triggered when
using App::import(). App import simply requires() the file.

On Jul 31, 1:44 pm, "euromark (munich)" <dereurom...@...>
wrote:
> actually there might be some occasions where you would need to do that
> - and where you could even call it appropriate
>
> but with core components, this is usually NEVER the case
>
> if you have a component that is totally isolated and does not need any
> startup() or controller related stuff, this works well
> but as soon as this happens (with most of the core components, which
> need again some other components or controller access) this gets
> really ugly
>
> in this case prepare everything inside the controller action and pass
> it along!
>
> On 31 Jul., 22:16, Miles J <mileswjohn...@...> wrote:
>
> > You are still not understanding what im saying. Either way, its bad
> > practice to put component code in helpers, if you are then it means
> > your doing it wrong.
Shadab Shaikh | 1 Aug 06:10 2009
Picon

Re: Calling component in helpers / Calling models in helpers

I had got your things.
Yes, I know that its bad practice.

But I am working one kind of application. In which later stage, we will need to find way by
which we can enter new functionality in the system easliy. We don't need to touch controller files. We want that if i want to add new functionality than i can easily do by entering few files/settings  with out disturbing earlier code.

By above way, if we make genralized helper  and component than for logic we will need to touch only two files and other small settings. By introducing component to call models, I am also using some what kind of MVC not directly calling modeles from helpers.

I will send details explaination soon in the group.

Thanks for every thing.

Shadab




On Sat, Aug 1, 2009 at 1:46 AM, Miles J <mileswjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

You are still not understanding what im saying. Either way, its bad
practice to put component code in helpers, if you are then it means
your doing it wrong.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php <at> googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Persivo Cunha | 1 Aug 07:42 2009
Picon

index.php of cakephp's core


Hi, people

i'm using apache2.2 + php5.2 and cake_1.2.3.8166. When i try to acess
localhost/cake_1.2.3.8166, folders and archives which are inside of
the cake appear, and index,php is not shown. However, If a click on
index.php, this page is shown correctly. Why isn't index.php called
automatically?
Martin Kirchgessner | 1 Aug 10:52 2009
Picon

Re: relations through habtm


Did you try to use the "recursive" param? I think you should call :

$news->find('all', array("recursive" => 2));

"recusive" defaults to 1, meaning it will get data from news and its
associated models (organisations_user). That's why you don't have User
and Organisation. By setting it to 2 find will also get fields from
models associated to organisations_user.

Hope this helps,

Martin

On 31 juil, 16:34, johan <forms...@...> wrote:
> Ive got a small problem with my cakephp app...
>
> I have in my design a habtm as a central table wich several other
> table relates to.
> This due to that Users can be members of different organisations over
> time
>
> news belongsTo organisations_user
> organisations_user hasOne user, organisation
> user hasAndBelongsToMany organisations
>
> Problem I have is that, when using $news->find('all')  i dont get any
> data from user och organisation
>
> Is there any way to pull data from theese two tables via this
> relationship?
Martin Kirchgessner | 1 Aug 11:00 2009
Picon

Re: Auth Component


Does your User model have both password and username fields?  If not
don't forget to set Auth's "fields" parameter.

Another problem may be the way your passwords are hashed before
they're saved to User. You should not use PHP's or MySQL's md5 or sha
functions, but $Auth->password instead  (or, if you set up a
registration form, User.password will automatically be hashed
correctly).

Martin

On 31 juil, 04:21, pete123456 <lumot...@...> wrote:
> thanks that seems to work,
> no i run into another issue. on my UsersController. the login form shows up
> but when i try to login i always get the message "username/password"
> correct.
> $someone['User']['password']  has the hashpassword but its still not
> working.
> any hints?
>
> thanks
>
> function login() {
>
>   if($someone['User']['password'] == $this->data['User']['password'])
>   {
>     echo "not able to get in here"
>
>
>
> }
> brian-263 wrote:
>
> > class SomeController extends AppController
> > {
> >    function beforeFilter()
> >    {
> >            parent::beforeFilter();
>
> >            $this->Auth->allowedActions = array('someAction', 'someOtherAction');
> >    }
>
> > On Thu, Jul 30, 2009 at 9:10 PM, pete123456<lumot...@...> wrote:
>
> >> Hi,
> >> i've added var $components = array('Auth'); to my AppController.
> >> Now i need to login on every single page, is there a way to remove the
> >> Authentication within certain controllers?
>
> >> thanks
>
> >> pete
> >> --
> >> View this message in context:
> >>http://www.nabble.com/Auth-Component-tp24749664p24749664.html
> >> Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> View this message in context:http://www.nabble.com/Auth-Component-tp24749664p24750099.html
> Sent from the CakePHP mailing list archive at Nabble.com.
johan | 1 Aug 11:42 2009
Picon

Re: relations through habtm


that works fine! although i cant seem to constrain the number of
fields select either by contain or fields...

On Aug 1, 10:52 am, Martin Kirchgessner <martin.ki...@...>
wrote:
> Did you try to use the "recursive" param? I think you should call :
>
> $news->find('all', array("recursive" => 2));
>
> "recusive" defaults to 1, meaning it will get data from news and its
> associated models (organisations_user). That's why you don't have User
> and Organisation. By setting it to 2 find will also get fields from
> models associated to organisations_user.
>
> Hope this helps,
>
> Martin
>
> On 31 juil, 16:34, johan <forms...@...> wrote:
>
>
>
> > Ive got a small problem with my cakephp app...
>
> > I have in my design a habtm as a central table wich several other
> > table relates to.
> > This due to that Users can be members of different organisations over
> > time
>
> > news belongsTo organisations_user
> > organisations_user hasOne user, organisation
> > user hasAndBelongsToMany organisations
>
> > Problem I have is that, when using $news->find('all')  i dont get any
> > data from user och organisation
>
> > Is there any way to pull data from theese two tables via this
> > relationship?
Piotr Kilczuk | 1 Aug 13:13 2009
Picon

Re: index.php of cakephp's core


Hello,

> i'm using apache2.2 + php5.2 and cake_1.2.3.8166. When i try to acess
> localhost/cake_1.2.3.8166, folders and archives which are inside of
> the cake appear, and index,php is not shown. However, If a click on
> index.php, this page is shown correctly. Why isn't index.php called
> automatically?

What modules are enabled by Apache?

Regards,
Piotr

Picon

Speed up load time page problem with Ajax Helper


Hi
I would speed up loading time page so I would create only one
javascript and load it at the bottom of page.
Now I have this problem in this only one javascript I have also
prototype and scriptaculous and in my page I use for example Ajax
helper but obiusvly I get a javascript error  if I load the javascript
at bottom of the page.
I ask if it is possible to continue to use Ajax helper and load the
javascript at bottom of the page.
Many Thanks
adam | 1 Aug 16:10 2009
Picon
Picon

Re: how to set "CHECKED" with form helper radio


Don't use his code exactly.  $radio_btn is an array of the options for
the.  Unless you make the array, leave that part out

Adam

On Jul 31, 1:53 pm, leafchild <leafchild.b...@...> wrote:
> Thank you, Miles for your comment.
>
> mmmm,,,, sometimes I'm confused which one I should use.
> I thought I should use form helper instead of html helper.
> Also your example is mixed with 'checkbox', I want to use radio botton
> not checkbox.
> I tried your code just in case but I got an error.
>
> thanks,
>
> On Jul 30, 12:45 pm, Miles J <mileswjohn...@...> wrote:
>
> > Do not use $form->radio(), you should be using $form->input().
>
> > $form->input('Test.test', array('type' => 'checkbox', 'options' =>
> > $radio_btn, 'value' => 1));
Antônio Marco | 1 Aug 16:16 2009
Picon

Re: Form with saving of true/false/null


I would use delocalizer's idea just changing the $optarray to:

('0' => 'No', '1' => 'Yes', 'null' => 'No info')

Good look.

On Jul 31, 7:33 am, delocalizer <conrad.leon...@...> wrote:
> As for the coding, just use the form helper's automagic radio input:
> eg
> <?= $form->input('fieldname',array('type'=>'radio','options'=>
> $optarray)); ?>
> $optarray is the array of options, eg. array
> ('0'=>'No','1'=>'Yes','2'=>'No info') for the example you give.
>
> On Jul 31, 8:29 pm, delocalizer <conrad.leon...@...> wrote:
>
> > The other way you can approach clearing radio input groups is to add
> > some little button or widget next to each group with a javascript
> > onClick function that sets the values to empty. At least that's what I
> > do. It looks prettier & and a bit more logical than an extra radio
> > option.
>
> > cheers,
> > Conrad.
>
> > On Jul 31, 4:13 pm, Kanten <anders.ho...@...> wrote:
>
> > > I have been giving this some thought and I do get what you mean, but
> > > it is very important that the user can always change e.g. an "yes"
> > > answer into "not info on subject". Database wise I think you are
> > > right, that I should define three different values (no = 0, yes = 1,
> > > no info = 2) instead of using no info = Null.
>
> > > Thank you very much for your help.
>
> > > /Anders
>
> > > On Jul 30, 9:41 am, delocalizer <conrad.leon...@...> wrote:
>
> > > > You sure you want an explicit third option 'no information on the
> > > > subject'? Wouldn't it be better to just have a radio group with 2
> > > > buttons (Yes/No or True/False) with a default value of NULL for that
> > > > field in your database? Or if you really want to have a third option
> > > > to force a user to enter something, mapping to a value other than
> > > > empty string or 'null' might be wise, as depending on how your db
> > > > field is defined, these may not be distinguishable from 'no data
> > > > entered'. The 'right' solution really depends on the particular logic
> > > > of your application - what data your users should enter and how that
> > > > data will be used and analysed once it's in the database.
>
> > > > On Jul 30, 12:40 am, "Richard <at> Home"
<richardath...@...> wrote:
>
> > > > > I'd use a drop down select instead of an option group.
>
> > > > > This should do the trick:
>
> > > > > <?php echo $form->input("Model.field", array("options"=>array(""=>"No
> > > > > information on subject", true=>"True", false=>"False))); ?>
>
> > > > > On Jul 29, 12:29 pm, Kanten <anders.ho...@...> wrote:
>
> > > > > > Is there really noone, that can help me with this one?
>
> > > > > > Thanks
> > > > > > Anders
>
> > > > > > On Jul 10, 1:49 pm, Kanten <anders.ho...@...> wrote:
>
> > > > > > > Hi,
>
> > > > > > > I am making a database for research and for this project I have a lot
> > > > > > > of dichotomous (binary) variables where I need to be able to
> > > > > > > discrimate between true, false and "no information on
> > > > > > > subject" (=null). I would like to store it as a bool field in MySQL.
> > > > > > > User interface wise I was thinking of using radio buttons with the
> > > > > > > option of choosing between the three posibilities.
>
> > > > > > > Is there some easy way of doing this using the builtin form helper, or
> > > > > > > do I need to to modify it somehow?
>
> > > > > > > Thanks
> > > > > > > Anders

Gmane