Extending FormHelper causes error in it

2014-05-30 Thread Sven Mäurer
I want to extend the FormHelper and used this part of a method's code to be called in the view. $out = parent::input($fieldName, $opts); return parent::output($out); Error: Call to a member function useTag() on a non-object File: ...lib/Cake/View/Helper/FormHelper.php Line: 861 the label met

Re: Extending FormHelper causes error in it

2014-06-05 Thread Sven Mäurer
Thanks for your answer. I want to make a LanguageHelper where languages and options are set in the method. These two lines should print it out. $options = array_merge(array( > 'label' => __('Country', true), > 'default' => $this->defaultCountry, > 'class' => nu

Re: Extending FormHelper causes error in it

2014-06-05 Thread Sven Mäurer
This is the complete method of my LanguageHelper. The two lines should make the finally output. $options = array_merge(array( 'label' => __('Country', true), 'default' => $this->defaultCountry, 'class' => null ), $options); $selected = $

Re: Extending FormHelper causes error in it

2014-06-07 Thread Sven Mäurer
nd kindly inform us of the result. > > Enjoy, John > > On Friday, 6 June 2014 09:32:27 UTC+3, Sven Mäurer wrote: >> >> This is the complete method of my LanguageHelper. The two lines should >> make the finally output. >> >> $options = array_merge(array( >&

Re: Extending FormHelper causes error in it

2014-06-08 Thread Sven Mäurer
y_diff_key($options, array('name' => null))); Any suggestions? Am Montag, 9. Juni 2014 07:59:06 UTC+2 schrieb Dakota: > > You need to ensure that you have public $helpers = array('Html'); in your > helper class. > > On Friday, 30 May 2014 14:58:55 UTC+2,

REST API server with Cakephp

2015-02-25 Thread Sven Mäurer
What are the best REST API server plugins? First of all I don't want to have the API methods in the controller I use for my web application and I want an URL like www.mydomain.de/api/v1/posts/ If possible also no view files, just directly encoded json. -- Like Us on FaceBook https://www.facebo

File upload from form with Http Client

2015-03-21 Thread Sven Mäurer
I have read the part about the Http Client: $http = new Client();$response = $http->post('http://example.com/api', [ 'image' => '@/path/to/a/file', 'logo' => $fileHandle]); and I have read the part about file input: echo $this->Form->create($article, ['type' => 'file']); But how can I combi

HttpClient SSL error

2015-03-22 Thread Sven Mäurer
I have my Http Client configured in a way that I would say it doesn't care about ssl certificates but still get the following error. $this->http = new Client([ 'host' => $this->base_url . 'api', 'scheme' => 'https', 'type' => 'json', 'timeout' => 5,

Re: HttpClient SSL error

2015-03-23 Thread Sven Mäurer
> > http://stackoverflow.com/a/23130512 > > On Sunday, March 22, 2015 at 8:40:19 PM UTC+8, Sven Mäurer wrote: >> >> I have my Http Client configured in a way that I would say it doesn't >> care about ssl certificates but still get the following error

Redirect everything except start page to https

2015-04-29 Thread Sven Mäurer
In my config file I have created two VirtualHosts. Below is the config that redirects to 443 where everything is configured and working. Now I want to make the startpage reachable without ssl but not the other pages. How can I achieve that? RewriteEngine On RewriteCond %{HTTPS} off RewriteRu

Parse checkbox value to boolean

2015-05-12 Thread Sven Mäurer
CakePHP3, no database A checkbox value is automatically converted to 0 or 1. If I want to make an external request I manually have to cast the value. Is it possible to tell the FormHelper that checkbox values should be handled as boolean and not as tinyint? -- Like Us on FaceBook https://www.

Use Paginator->sort without Paginator in the Controller

2015-05-16 Thread Sven Mäurer
In my controller I am calling a REST API so I just want to use the Paginator for setting query paramters. How can I achieve that nevertheless the sorting direction is toggled when clicking the Paginator->sort link? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http:

Re: Extending core CakePlugin class in app directory

2015-05-16 Thread Sven Mäurer
If you are using composer you can set a flag to download the source files which you than can edit without showing that you have to submit changes. Am Mittwoch, 13. Mai 2015 10:42:24 UTC+2 schrieb cj ramki: > > Hi guys.. I have a question in cakephp 2.6.4 - plugins. > I have a plan to add some fea

Logout and redirect from component

2015-05-22 Thread Sven Mäurer
In a custom component I am making API calls. If the API call returns 403 I want to logout the user and redirect to the login. $this->Cookie->delete(TOKEN); $this->Cookie->delete(USER); $controller = $this->_registry->getController(); $string = $controller->Auth->l

Assets via IP working but not with domain

2015-06-30 Thread Sven Mäurer
I configured my virtual host like this: http://pastebin.com/Hgu3se5A Access via IP is working but not with the URL. Than I got problems with the assets. In the core file I set the Configure::write('App.fullBaseUrl', 'www.innolabvenlo.nl'); The /etc/hosts file has the entry of: ipinnolabve

Module System

2015-09-14 Thread Sven Mäurer
Which is the best way of implementing a module system? I am implementing a shop and want the user to select a theme or if product evaluations are enabled or not. Any ideas? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received t

SEO friendly URLs - Route overrouling all others

2015-10-06 Thread Sven Mäurer
After adding the following snipped in the routes file I got what I want. Router::connect('/sites/:name', ['controller' => 'sites', 'action' => 'view'], ['pass' => ['name']]); But now all actions I want to invoke on the sites controller are gone. How can I enable them? Do I have to add every m

Virtual Field alternative with "belongs to" Relation

2015-11-09 Thread Sven Mäurer
I have a category model which can have a parent. In want a virtual field that also shows the parent before the own name. The parent is not required. As far as I researched virtual fields are not working with relatd models. Any suiggestions? -- Like Us on FaceBook https://www.facebook.com/CakeP

Route is overwriting routes of same controller

2015-12-28 Thread Sven Mäurer
Is it right that all other routes of the same controller are overwritten if I define the following? Router::connect( '/catalogs/:name', ['controller' => 'catalog_groups', 'action' => 'view'], ['name' => '[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*'] ); I am using CakePHP 2.7.* -- Like Us on F