how to create model, controller and view files in Croogo cms? - croogo

I am trying to create a contact form with validation in Croogo, I don't know where to create the ctp files and the controller for it. I did this in cakephp but I could not do the same in Croogo. Help me with this.

I have created it in the nodes folder. As this is the first time I am using this I struggled with it. I have created the view files and the controller files in the respective view and controller folder in the nodes folder.

Related

Creating a Theme / Template for iOS application?

I am creating an application where there are some views i want to be available in each and every UIView Controller just like a master page in Web Development. i have created those views but how to add them to all the view controllers in the application automatically?
You should add them to mainWindow if you need to display them in all viewcontrollers.
Hope it helps you.
You need to convert the project and all the views that you created to a template first and then create a new project and use that template. Here is a guide I have used:
This guide explains how to create new project templates in Xcode. Project templates appear in the list of project types in the New Project dialog.
1.Create a new project and setup everything as you'd like (NIB files, graphics, sounds, settings, code etc)
Optionally, build and make sure the project works
Use Finder and locate the project folder for your project you created in step 1
Open another Finder window and navigate to /Library/Application Support/Apple/Developer Tools/Project Templates/. You have two options here:
Create a new folder for your custom project templates - this will appear as a category when creating a new project in XCode
Choose an already existing folder (eg Application) - this will place the project template in that category
5.Open the new/chosen category folder and create a new folder inside. You can name this new folder whatever you like and it will appear as the project template name.
6.Copy all files from the project folder in step 3 to the new template folder created in step 5.
7.Try to create a new project in Xcode. You should see your project template in one of the original categories or in the category you created, whichever you decided.
Note: If you built the project, delete the build folder from the template folder.
Hope this would help you out.
Create a base view controller class which will have all these UIViews added in its view. Additionally, you can also implement the events of these particular views in the controller. Other controllers that you create need to extend from this base view controller class.

Redirect to a custom phtml file from a controller in Magento?

I have a Magento controller and a phtml file. How can I redirect to that file in my controller action? I searched the net, but found nothing. Ideas?
Thanks!
If you mean that you want to show the contents of your phtml-file when visiting the URL of the controller, you should follow this tutorial: Baobaz Controller Tutorial
It has everything in it you need. Even interaction between the controller and the template.
Remember to adjust the paths and class names to your solution.

Xcode iPhone: New Project Template, Combine?

This question is simple... you have a choice of which Template you'd like to use when creating a new iPhone application in Xcode.
What if I choose a View-Based, but I need a Navigation-Based application too? Can you combine the various templates within a project? I mean, is it just a matter of creating a new .xib file and dragging on the various UI components?
The navigation based template is also view based. Look at the code, the navigation based template contains a rootViewController which loads its view from a xib file.
You cannot combine templates automatically you'll have to do it yourself.
You can always create custom templates as you want. You just need to pick a template from Xcode then you can modify it as you want and just place it on a proper location.
Read my this blog post for a better understanding - http://www.makebetterthings.com/blogs/iphone/how-to-create-xcode-project-templates/

iOS project not showing Interface elements built from Interface Builder in my view

I am working on a project which includes many UI components on one view(being built in Interface Builder). I have found that after saving and moving my project directory, the interface which should include all of these elements, is empty(there are no visible UI components in the view).
There are actually 2 projects. 1 is a framework project, the other is the iphone project which i build & run on the device - everything is contained within a folder which i may move frequently as other members in my team work on it.
the view which is not properly showing elements, is an XIB file which can be modified through either the iphone project or framework project.
Why is this happening and how can i troubleshoot this problem further? I am not sure how to fix it.
Many components will not show if they're not been connected to a property, and some will not show if their datasource or delegate is not connected.
Have you wired everything up, making all of your connections?
Could you check the view hierarchy in the -(void)viewDidLoad ? As Matthew said, if those components are not connected to properties, they won't be shown. And, if they are not add onto proper view, then they won't be shown too.
You can check the view hierarchy of viewController by browsing the property subViews of self.view.

Best way to set-up an iPhone project?

Looking for the best way to set-up an iPhone project in XCode ... namely:
What is the preferred project template to start with (e.g View-Based or Windows-Based application)?
What folder structure should I create in XCode to manage the project? For example, under "Classes" is it a preferred practice to add Models, Views and Controllers sub-folders?
Any other best practices, tips, etc... would be appreciated.
Thanks
Take the most "complicated" template, based on your level of knowledge. I usually start out with the "Window-based application" myself, and add components one at a time from there.
I keep all of my code (.m/.h/.c/etc) in the "Classes" folder and only rarely add subdirectories to it. One exception is a "Generated" subdirectory for classes generated from Core Data entities.
When I create a new UIViewController subclass, I rename the resulting .xib to remove the "Controller" part; i.e. MyViewController.m gets paired with MyView.xib. (I think MyViewController.xib reads funny, as the xib isn't for the controller, it's for the view.) I also move the .xibs into their own directory next to the project file to keep things tidy.
There is no "best" template. Window-based is the most basic, while View-based starts you out with a view and a view controller.
I'm with Shaggy Frog on renaming xib files to not have "controller" in the name. However, I like to create groups to logically separate functionality, and in those groups I place view controller code along with the xib files those view controllers use. Then you know what belongs with what.
I also like a create a top-level "Application" group into which I put the app delegate, main xib file (if any), pch file, info.plist, app icon, Default.png and other things related just to the application so they are all easy to find - after you add a number of files each of those things can get lost in giant lists of stuff.
Basically organize things so you can find them, a structure that makes sense to you might not to someone else.
Window-based provides you with the most flexibility, and is probably what you want to choose after you've got a couple of projects under your belt. I find with the other templates that I'm usually removing too much code, and it would be quicker to just start from scratch.
I usually setup my projects by creating 4 subfolders under Classes: "Views", "View Controllers", "Model Objects" and "Helpers". Model objects contains all the basic object types, where as Helpers contains things like utility classes or similar. Sometimes, where relevant, I will also create a Table Cells folder underneath both Views and View Controllers. I move MainWindow.xib to the Views folder.
If the project is large, I will sometimes also have sub-folders for the Views and View Controllers based on the UITabBarController tabs. So if I have 5 tabs, then the Views folder will have 5 sub-folders, as will the View Controllers folder. I find this helps to keep everything logically together in the same place.
One other thing I do is create an Images folder under Resources, otherwise that folder gets way too cluttered very quickly.