I want to define the static function so that the user name ( firstname
+ lastname ) can be used everywhere in
view.
Class User{
static function getName( $id ){
$userObj = $userObj - read( 'id', $id );
return $userObj[ 'User' ][ 'firstname' ] . ' ' . $userObj[ 'User' ]
[ 'lastname' ];
}
}
i have added helpers and component of request handler in controller.
i have created a view with delete link as bellow
?php foreach ($users as $user): ?
tr
td?php echo $user['User']['id']; ?/td
td?php echo $this-Html-link($user['User']['name'],
Use a virtual field: http://book.cakephp.org/view/1608/Virtual-fields
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 24 Jan 2011, at 08:01, cake-learner wrote:
I want to define the static function so that the user name ( firstname
+ lastname ) can be used
i have added helpers and component of request handler in controller.
i have created a view with delete link as bellow
?php foreach ($users as $user): ?
tr
td?php echo $user['User']['id']; ?/td
td?php echo $this-Html-link($user['User']['name'],
Actually you can do exactly what you say with CakePHP ACL. By default,
the AclComponent allow() and deny() methods save 1 and -1 respectively
for all fields _create, _read, _update and _delete. Then if you use
the AclComponent to check if a user is authorized to do some actions,
the check() method
regarding the comments I feel they should be more visible, definetly,
but...
I would do 2 thinks to prevent misleading info:
1- post them as a thread to this group with the text of the page above
so it allows quick answer from this group
and...
2- have a rating system like thumbs up or down to
On Jan 24, 9:50 am, netusco ernestcon...@gmail.com wrote:
regarding the comments I feel they should be more visible, definetly,
but...
why?
Has anyone pro-comments SEEN what's in the existing comments?
Comments were added to the book because it was easy to do so. However
they were /not/
Hey everybody
I wish you all a good start into the new week. :-)
Sadly the first thing I encountered after starting the PC today at my
workplace is a strange little problem.
View:
?php echo $this-Form-create(array('action' = 'detailangaben',
'type' = 'get')); ?
fieldset
legend?php
hi,
i have tested ur code and it is giving me output as bellow
tdselect name=data[geburtsdatum_tag] id=geburtsdatum_tag
/select /td
which showing that the name of select tag is not empty. this may ur
misconception but it is working fine.
ok
bye
On Jan 24, 2:12 pm, psybear83
Thanks for testing it, Andy!
I used CakePHP 1.3.6, and now I upgraded to CakePHP 1.3.7 - and now it
works again! But on friday it also worked on the old version, and I
can't remember any significant change that could have stopped it from
working! Hell - strange...!
Anyway, it's working again.
you will need to create a custom template
/templates/custom/views/form.ctp
and add your empty='' snippet for all belongsTo relations
On 24 Jan., 02:45, Ryan Schmidt google-2...@ryandesign.com wrote:
Thanks, that works great, specifically:
echo $this-Form-input('some_id',
Hey everybody
I'm currently doing l10n for my web. I have browsed through some
articles, and their alltogehter-verdict was:
- Put uses('L10n'); into your AppController.
- Put Configure::write('Config.language', 'de'); into your
bootstrap.php File
- Change the display language by setting the
Oh, and it seems uses('L10n'); is also not needed?
On Mon, Jan 24, 2011 at 12:06 PM, psybear83 psybea...@gmail.com wrote:
Hey everybody
I'm currently doing l10n for my web. I have browsed through some
articles, and their alltogehter-verdict was:
- Put uses('L10n'); into your AppController.
When i add new table it sometimes say request address /somepath/
somepath was not found on this server.
I know i configure model wrong because of this it takes time to find
the problem. Is there any way to see proper error?
--
Our newest site for the community: CakePHP Video Tutorials
I've recently stumbled across a major problem which has brought the
development of my application to a complete stand still.
Basically, the way the application has been working up until now, is a
view would be loaded into a div tag via AJAX. This view would contain
an AJAX form which when
never mind i didn't have debug level to 2
On Mon, Jan 24, 2011 at 3:37 AM, cake-learner sh.koiz...@gmail.com wrote:
When i add new table it sometimes say request address /somepath/
somepath was not found on this server.
I know i configure model wrong because of this it takes time to find
the
As far as I remember, you should use the same abbreviations in your
configure statements as you have in your language folder name - so
german is not de but deu and so on.
Enjoy,
John
On 24 Jan., 12:06, psybear83 psybea...@gmail.com wrote:
Hey everybody
I'm currently doing l10n for my web. I
Thanks, yes, i'd renamed them for my own purposes, sorry about that!
I'll give all that a go.
Thanks again.
On Jan 22, 2:53 pm, cricket zijn.digi...@gmail.com wrote:
On Sat, Jan 22, 2011 at 9:37 AM, WhyNotSmile sharongilmor...@gmail.com
wrote:
Another question:
what are 'pages_modal'
I have problems understanding your question. If you have a date field in
your model, then $this-Form-input('date') should result in a day select
box, a month select box and a year select box. If you have a datetime field,
then it should also result in hour/minute/second select boxes.
You can also
How do you do every one.
I used ACL for user authentication, and now it works well.
However, when user logs in with wrong information, he(or she) gets
redirected to login page without any message.
I am wondering if no way to show any message like Your login
information is not correct, etc.
No
Hi, everyone.
I ve entered CakePHP world recently and bumped into one issue.
I need to get logged users information, especially primary key value
in user table.
I have tried $this-Auth-user[id] because I have read it from one
post in this group, but I checked that $this-Auth does not have any
user
If it is not a typo, the reason is that it is not $this-Auth-
user[id] but $this-Auth-user(id).
user() is a function of the AuthComponent, not a property.
Regards,
nIcO
On Jan 24, 11:49 am, raymond raymond...@gmail.com wrote:
Hi, everyone.
I ve entered CakePHP world recently and bumped into
Thanks Amit, I manage to do that,
but I have another problem,... Once user is a member now I need that
Join button replaced with Leave and I can not make that php
statement.
e.g. ?php if(($favorite['Favorite']['user_id'] ==)): ? ...? ? ?
the table I have is
id int(11)
Hi Sam,
thanks for help...
and how do I do that...?
Here is another example, what I have is a video to be favorite. And
once its favorite it, the button Add to Favorites should not be
seen.
The table for favorites I have is:
id int(11) UNSIGNEDNo auto_increment
Hi Sam,
thanks for help...
and how do I do that...?
Here is another example, what I have is a video to be favorite. And
once its favorite it, the button Add to Favorites should not be
seen.
Well, there's 2 ways to do this:
1. Process the 'favourite' action via ajax, and on success hide the
Your pages should be on different actions?
/resume/add
/resume/edit
/resume/delete
And within each of those you show the context specific links.
On Jan 24, 11:10 am, chris...@yahoo.com chris...@yahoo.com wrote:
Hi Sam,
thanks for help...
and how do I do that...?
Here is another example,
On Mon, Jan 24, 2011 at 2:10 PM, chris...@yahoo.com chris...@yahoo.com wrote:
Hi Sam,
thanks for help...
and how do I do that...?
Here is another example, what I have is a video to be favorite. And
once its favorite it, the button Add to Favorites should not be
seen.
The table for
Chris, forgive me if I'm not reading your original request properly,
because I seem to be missing something...
In CakePHP, the view.ctp is usually used to display the contents of an
EXISTING record, so having the option to Create Resume using this
view doesn't make sense to me. In fact, if you
I do NOT see comments on the cakephp documentation to be valuable.
I think comments like php.net are great when your talking about how to
use a function. Most of the content of the cakephp book is how to use
the framework a little bit more extensive than a sequence of function
calls. This is
gobb0,
Microsoft SQL Azure can be connected to by php using the Microsoft SQL
Server Driver for PHP
So you should be able to connect to the db from CakePHP using the
dbo_mssql.php DataSource Driver.
http://book.cakephp.org/view/1075/DataSources
You see, Cakephp has supported Azure since before
Hey there
I am designing a database layout for a project and it has quite a few drop
down menus, these are mostly static, lets say for example:
Income:
- Do not disclose
- £15,000 - £25,000
- £25,000 - £35,000
- etc.
These are unlikely to change over time whilst the website grows, normally
Assuming
ModelA hasMany ModelB
ModelB includes a date column called 'date'
you could try:
$this-ModelA-bindModel(array(
'hasOne' = array(
'MaxDateModelB' = array(
'className' = 'ModelB',
'foreign_key = 'model_a_id',
'conditions' =
Thanks euromark. You, and the other cakers below confirmed that I’m not
insane. The most important thing I’ve gleaned from this thread is that I
really need to start following the roadmap (and migration guides) for 2 and
beyond to get a better idea of the direction the development team are
That’s a neat little solution. I always enjoy getting dirty forking the
libs/ directory myself.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related
cricket,
It's not about just 'union'. I don't want to be dealing with cakephp
style quering here. I am talking about plain sql query. Passing a pure
mysql query into pagination.
I did it, and it worked. The problem however is when I am trying to go
with reqular CakePHP pagination within the same
Is it possible to take 2 models and paginate as 1?
I have 2 models where
(model 1) the data is automatically generated thru the site database simply
has 3 fields (id, User_id, and entry_id) = all the data is gathered thru
the entry_id
(model 2) user fills out a form and enters all the data
The line
RewriteCond %{SERVER_PORT} !^80$
seems to indicate that your RewriteRule's are only applied if the
incoming request is NOT coming in from port 80 (port 80 is usually the
http:// port, while port 443 is usually the https:// port). The !
negates the pattern, so I think you will get
By the way, the tinyint method I mentioned, this involves defining arrays in
bootstrap.php and using Configure::write // Configure::read for the select
boxes.
On 24 January 2011 21:26, Stephen step...@ninjacodermonkey.co.uk wrote:
Hey there
I am designing a database layout for a project and
I agree comments CAN BE great!
BUT
Should be left to the professionals. Mr Cake Baker (sorry if someone has
that name...not intentional) who has 2 days use with Cake thinking he is an
expert posting bad comments everywhere adding misguided information helps
no-one. With the framework
I'm not seeing anything in your code that would produce a confirmation
request. Your delete link in your view is
echo $html-link('Delete',array('action'='delete',
$user['User']['id']),array('class'='confirm_delete'));
Are you attaching JS code to the click event of DOM objects with the
On Mon, Jan 24, 2011 at 5:04 PM, mmamedov mmame...@gmail.com wrote:
cricket,
It's not about just 'union'. I don't want to be dealing with cakephp
style quering here. I am talking about plain sql query. Passing a pure
mysql query into pagination.
As I said, 'union' was an arbitrary key. I
On Mon, Jan 24, 2011 at 4:26 PM, Stephen step...@ninjacodermonkey.co.uk wrote:
Hey there
I am designing a database layout for a project and it has quite a few drop
down menus, these are mostly static, lets say for example:
Income:
- Do not disclose
- £15,000 - £25,000
- £25,000 -
Well, I don't want all belongsTo relations to allow NULL selections; logically,
I only want this allowed for those defined in the database as allowing NULL
values. So my question is how can I do that, and my second question is why the
default cake baking templates don't already do that.
On
you might wanna try:
http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/
On 25 Jan., 00:11, cricket zijn.digi...@gmail.com wrote:
On Mon, Jan 24, 2011 at 4:26 PM, Stephen step...@ninjacodermonkey.co.uk
wrote:
Hey there
I am designing a database layout for a
debug your bake scripts variables - especially the content of the
schema
it might be in there somewhere if NULL is allowed or not
then you can easily change the default behavior
well, because its not that important - at least not for anybody
else :)
but as the core team would say: feel free to
thanks ShadowCross
i was looking for the same,
thank u,
by,
Andy
On Jan 25, 3:49 am, ShadowCross adri...@jps.net wrote:
I'm not seeing anything in your code that would produce a confirmation
request. Your delete link in your view is
echo $html-link('Delete',array('action'='delete',
46 matches
Mail list logo