Works for me - I'm on 1.3 - are you?
On 29 Apr 2010, at 15:24, Andrei Mita wrote:
In the view?
If yes, I get this:
Notice (8): Undefined property: View::$Profile [APP/views/profiles/edit.ctp, line 17]
Code |
Context$___viewFn = "/var/www/fotopoetica/app/views/profiles/edit.ctp" $___dataForView = array( "cakeDebug" => ProfilesController ProfilesController::$name = "Profiles" ProfilesController::$helpers = array ProfilesController::$components = array ProfilesController::$here = "/fotopoetica/profiles/edit/1" ProfilesController::$webroot = "/fotopoetica/" ProfilesController::$action = "edit" ProfilesController::$uses = false ProfilesController::$params = array ProfilesController::$data = array ProfilesController::$paginate = array ProfilesController::$viewPath = "profiles" ProfilesController::$layoutPath = NULL ProfilesController::$viewVars = array ProfilesController::$pageTitle = false ProfilesController::$modelNames = array ProfilesController::$base = "/fotopoetica" ProfilesController::$layout = "default" ProfilesController::$autoRender = false ProfilesController::$autoLayout = true ProfilesController::$Component = Component object ProfilesController::$view = "View" ProfilesController::$ext = ".ctp" ProfilesController::$output = NULL ProfilesController::$plugin = NULL ProfilesController::$cacheAction = false ProfilesController::$persistModel = false ProfilesController::$passedArgs = array ProfilesController::$scaffold = false ProfilesController::$methods = array ProfilesController::$modelClass = "Profile" ProfilesController::$modelKey = "profile" ProfilesController::$validationErrors = NULL ProfilesController::$_log = NULL ProfilesController::$Session = SessionComponent object ProfilesController::$Profile = Profile object ) $loadHelpers = true $cached = false $loadedHelpers = array( "Html" => HtmlHelper HtmlHelper::$tags = array HtmlHelper::$base = "/fotopoetica" HtmlHelper::$here = "/fotopoetica/profiles/edit/1" HtmlHelper::$params = array HtmlHelper::$action = "edit" HtmlHelper::$data = array HtmlHelper::$_crumbs = array HtmlHelper::$__docTypes = array HtmlHelper::$helpers = NULL HtmlHelper::$webroot = "/fotopoetica/" HtmlHelper::$themeWeb = NULL HtmlHelper::$plugin = NULL HtmlHelper::$namedArgs = NULL HtmlHelper::$argSeparator = NULL HtmlHelper::$validationErrors = NULL HtmlHelper::$__tainted = NULL HtmlHelper::$__cleaned = NULL HtmlHelper::$_log = NULL, "Form" => FormHelper FormHelper::$helpers = array FormHelper::$fieldset = array FormHelper::$__options = array FormHelper::$fields = array FormHelper::$requestType = "put" FormHelper::$base = "/fotopoetica" FormHelper::$webroot = "/fotopoetica/" FormHelper::$themeWeb = NULL FormHelper::$here = "/fotopoetica/profiles/edit/1" FormHelper::$params = array FormHelper::$action = "edit" FormHelper::$plugin = NULL FormHelper::$data = array FormHelper::$namedArgs = NULL FormHelper::$argSeparator = NULL FormHelper::$validationErrors = NULL FormHelper::$tags = array FormHelper::$__tainted = NULL FormHelper::$__cleaned = NULL FormHelper::$_log = NULL FormHelper::$Html = HtmlHelper object, "Time" => TimeHelper TimeHelper::$helpers = NULL TimeHelper::$base = "/fotopoetica" TimeHelper::$webroot = "/fotopoetica/" TimeHelper::$themeWeb = NULL TimeHelper::$here = "/fotopoetica/profiles/edit/1" TimeHelper::$params = array TimeHelper::$action = "edit" TimeHelper::$plugin = NULL TimeHelper::$data = array TimeHelper::$namedArgs = NULL TimeHelper::$argSeparator = NULL TimeHelper::$validationErrors = NULL TimeHelper::$tags = array TimeHelper::$__tainted = NULL TimeHelper::$__cleaned = NULL TimeHelper::$_log = NULL, "Javascript" => JavascriptHelper JavascriptHelper::$useNative = true JavascriptHelper::$enabled = true JavascriptHelper::$safe = false JavascriptHelper::$tags = array JavascriptHelper::$_blockOptions = array JavascriptHelper::$_cachedEvents = array JavascriptHelper::$_cacheEvents = false JavascriptHelper::$_cacheToFile = false JavascriptHelper::$_cacheAll = false JavascriptHelper::$_rules = array JavascriptHelper::$__scriptBuffer = NULL JavascriptHelper::$helpers = NULL JavascriptHelper::$base = "/fotopoetica" JavascriptHelper::$webroot = "/fotopoetica/" JavascriptHelper::$themeWeb = NULL JavascriptHelper::$here = "/fotopoetica/profiles/edit/1" JavascriptHelper::$params = array JavascriptHelper::$action = "edit" JavascriptHelper::$plugin = NULL JavascriptHelper::$data = array JavascriptHelper::$namedArgs = NULL JavascriptHelper::$argSeparator = NULL JavascriptHelper::$validationErrors = NULL JavascriptHelper::$__tainted = NULL JavascriptHelper::$__cleaned = NULL JavascriptHelper::$_log = NULL, "Session" => SessionHelper SessionHelper::$helpers = NULL SessionHelper::$__active = true SessionHelper::$valid = false SessionHelper::$error = false SessionHelper::$_userAgent = "b602d9365fcff6737d055a3ae7a8f1ba" SessionHelper::$path = "/" SessionHelper::$lastError = NULL SessionHelper::$security = "high" SessionHelper::$time = 1272550965 SessionHelper::$sessionTime = 1272556965 SessionHelper::$watchKeys = array SessionHelper::$id = NULL SessionHelper::$_log = NULL SessionHelper::$base = "/fotopoetica" SessionHelper::$webroot = "/fotopoetica/" SessionHelper::$here = "/fotopoetica/profiles/edit/1" SessionHelper::$params = array SessionHelper::$action = "edit" SessionHelper::$data = array SessionHelper::$themeWeb = NULL SessionHelper::$plugin = NULL ) $helper = "Session" $camelBackedHelper = "session" $html = HtmlHelper HtmlHelper::$tags = array HtmlHelper::$base = "/fotopoetica" HtmlHelper::$here = "/fotopoetica/profiles/edit/1" HtmlHelper::$params = array HtmlHelper::$action = "edit" HtmlHelper::$data = array HtmlHelper::$_crumbs = array HtmlHelper::$__docTypes = array HtmlHelper::$helpers = NULL HtmlHelper::$webroot = "/fotopoetica/" HtmlHelper::$themeWeb = NULL HtmlHelper::$plugin = NULL HtmlHelper::$namedArgs = NULL HtmlHelper::$argSeparator = NULL HtmlHelper::$validationErrors = NULL HtmlHelper::$__tainted = NULL HtmlHelper::$__cleaned = NULL HtmlHelper::$_log = NULL $form = FormHelper FormHelper::$helpers = array FormHelper::$fieldset = array FormHelper::$__options = array FormHelper::$fields = array FormHelper::$requestType = "put" FormHelper::$base = "/fotopoetica" FormHelper::$webroot = "/fotopoetica/" FormHelper::$themeWeb = NULL FormHelper::$here = "/fotopoetica/profiles/edit/1" FormHelper::$params = array FormHelper::$action = "edit" FormHelper::$plugin = NULL FormHelper::$data = array FormHelper::$namedArgs = NULL FormHelper::$argSeparator = NULL FormHelper::$validationErrors = NULL FormHelper::$tags = array FormHelper::$__tainted = NULL FormHelper::$__cleaned = NULL FormHelper::$_log = NULL FormHelper::$Html = HtmlHelper object $time = TimeHelper TimeHelper::$helpers = NULL TimeHelper::$base = "/fotopoetica" TimeHelper::$webroot = "/fotopoetica/" TimeHelper::$themeWeb = NULL TimeHelper::$here = "/fotopoetica/profiles/edit/1" TimeHelper::$params = array TimeHelper::$action = "edit" TimeHelper::$plugin = NULL TimeHelper::$data = array TimeHelper::$namedArgs = NULL TimeHelper::$argSeparator = NULL TimeHelper::$validationErrors = NULL TimeHelper::$tags = array TimeHelper::$__tainted = NULL TimeHelper::$__cleaned = NULL TimeHelper::$_log = NULL $javascript = JavascriptHelper JavascriptHelper::$useNative = true JavascriptHelper::$enabled = true JavascriptHelper::$safe = false JavascriptHelper::$tags = array JavascriptHelper::$_blockOptions = array JavascriptHelper::$_cachedEvents = array JavascriptHelper::$_cacheEvents = false JavascriptHelper::$_cacheToFile = false JavascriptHelper::$_cacheAll = false JavascriptHelper::$_rules = array JavascriptHelper::$__scriptBuffer = NULL JavascriptHelper::$helpers = NULL JavascriptHelper::$base = "/fotopoetica" JavascriptHelper::$webroot = "/fotopoetica/" JavascriptHelper::$themeWeb = NULL JavascriptHelper::$here = "/fotopoetica/profiles/edit/1" JavascriptHelper::$params = array JavascriptHelper::$action = "edit" JavascriptHelper::$plugin = NULL JavascriptHelper::$data = array JavascriptHelper::$namedArgs = NULL JavascriptHelper::$argSeparator = NULL JavascriptHelper::$validationErrors = NULL JavascriptHelper::$__tainted = NULL JavascriptHelper::$__cleaned = NULL JavascriptHelper::$_log = NULL $session = SessionHelper SessionHelper::$helpers = NULL SessionHelper::$__active = true SessionHelper::$valid = false SessionHelper::$error = false SessionHelper::$_userAgent = "b602d9365fcff6737d055a3ae7a8f1ba" SessionHelper::$path = "/" SessionHelper::$lastError = NULL SessionHelper::$security = "high" SessionHelper::$time = 1272550965 SessionHelper::$sessionTime = 1272556965 SessionHelper::$watchKeys = array SessionHelper::$id = NULL SessionHelper::$_log = NULL SessionHelper::$base = "/fotopoetica" SessionHelper::$webroot = "/fotopoetica/" SessionHelper::$here = "/fotopoetica/profiles/edit/1" SessionHelper::$params = array SessionHelper::$action = "edit" SessionHelper::$data = array SessionHelper::$themeWeb = NULL SessionHelper::$plugin = NULL $cakeDebug = ProfilesController ProfilesController::$name = "Profiles" ProfilesController::$helpers = array ProfilesController::$components = array ProfilesController::$here = "/fotopoetica/profiles/edit/1" ProfilesController::$webroot = "/fotopoetica/" ProfilesController::$action = "edit" ProfilesController::$uses = false ProfilesController::$params = array ProfilesController::$data = array ProfilesController::$paginate = array ProfilesController::$viewPath = "profiles" ProfilesController::$layoutPath = NULL ProfilesController::$viewVars = array ProfilesController::$pageTitle = false ProfilesController::$modelNames = array ProfilesController::$base = "/fotopoetica" ProfilesController::$layout = "default" ProfilesController::$autoRender = false ProfilesController::$autoLayout = true ProfilesController::$Component = Component object ProfilesController::$view = "View" ProfilesController::$ext = ".ctp" ProfilesController::$output = NULL ProfilesController::$plugin = NULL ProfilesController::$cacheAction = false ProfilesController::$persistModel = false ProfilesController::$passedArgs = array ProfilesController::$scaffold = false ProfilesController::$methods = array ProfilesController::$modelClass = "Profile" ProfilesController::$modelKey = "profile" ProfilesController::$validationErrors = NULL ProfilesController::$_log = NULL ProfilesController::$Session = SessionComponent object ProfilesController::$Profile = Profile object
<?php echo $form->create('Profile');?>
<fieldset>
<legend><?php __('Modifica Profil - '.$this->Profile->value('Profile.name'));?></legend>
include - APP/views/profiles/edit.ctp, line 17 View::_render() - CORE/cake/libs/view/view.php, line 666 View::render() - CORE/cake/libs/view/view.php, line 376 Controller::render() - CORE/cake/libs/controller/controller.php, line 806 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 230 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194 [main] - APP/webroot/index.php, line 88
Fatal error: Call to a member function value() on a non-object in /var/www/fotopoetica/app/views/profiles/edit.ctp on line 17
On Thu, Apr 29, 2010 at 5:17 PM, Jeremy Burns
<jeremyburns@me.com> wrote:
Try: $this->Form->value('Model.field_name');
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949 (h) +44 208 530 7573
On 29 Apr 2010, at 15:14, Andrei Mita wrote:
Hello,
In a basic CRUD application I have a user's profile edit page.
When /profiles/edit/4 page is accessed the action in the controller checks if an id is passed, then if I have some data to be saved.
If the id is present but no data, it reads the id related data and then pass it to a view like this:
$this->data = $this->Profile->read(null, $id);
The view is a basic form with lots of echo $form->input('field');
My question is: how can I access the data sent from the controller?
For instance, I want to write a the top of my view: Modifying profile for $data['name']
Do I have to put in my controller: $this->set('profile', $this->Profile->read(null, $id)); ??
Thanks
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@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com 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@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com 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@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment