Codeigniter Phpstorm



CodeIgniter 3.1.11 is the current version of the framework, intended for use with PHP 5.6+. There have been a number of refinements since version 2, notably with the database, session handling and encryption. Development of this version is ongoing. CodeIgniter Rocks. CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. A PhpStorm plugin for CodeIgniter development.

  1. Config Codeigniter Phpstorm
  2. Phpstorm Codeigniter 설정
  3. Codeigniter Phpstorm Code Completion

As a developer, you may familiar with this concept .DRY. Which means don't reinvent the wheel?

All we do to make our life much easier because this will increase productivity which converts at the end to money

So I thought to share simple tips from my experience that will help you in Codeigniter projects and makes your life easier

1- Use HMVC approach

If you don’t know what is HMVC

A. Modular HMVC is: Hierarchy of multiple MVC triads

Separate your code as modules makes your code clean, easy to maintain and gives you the chance to reusing code many times without effort to mention

The most popular HMVC wiredesignz is my favorite tool.

Codeigniter modular application is the way to go because every module handles a specific logic, so collect similar controllers and models ,libraries in one module let you less confusing and after a while, you could remember what you did in this module, then it will be easy to copy module with all its own code.

Remember: that HMVC Warez used only with Codeigniter 2 and Codeigniter 3 version, Codeigniter 4 use namespaces to handle modular approach

2- Use Base model

If you don't know what base model you should know about it is, basically it is a parent model class which provides the most popular functions that every developer needs for every project

As an example, every project needs CRUD functionality (create-read-update-delete).

So rather than write those functions more and more, you just call one inherited function with Short syntax and it will do the magic.

Phpstorm

So if you have a ton of models this will increase your productivity and you would notice that .

also, it will make your model thin because you will focus on the project specific logic.

I suggest to use this Codeigniter base model, it is simple, light and you can customize for your tasks

Note: Codeigniter 4 will come with its own base model and it is syntax much like this class.

3- Build your own helper

Usually, In many projects, there were something repeated and you were forgetting to change or may by lazy like me to change.

Something like truncate functions which count and cut number of words

Or a function to create thumbnails for images to fit website design or date converter function.

You should collect those functions and build your own helper to use in all projects. This habit will make you code cleaning and fewer efforts.

4- Use a better editor

My best choice is Phpstorm ,I love this editor, it has all tool you need as a PHP developer, you can manage FTP very well ,you can manage VCS with GIT repository without worried about commands ,I have already make a git course to this subject and it will complete as soon as possible

Also, you can make your shortcuts for repetitive codes to reduce coding time and save these settings anywhere to share between many computers.

As example many time I use

to show what query run behind the scene this helps me a lot to fix database query errors so I thought to make a shortcut for this like this (lst) ,So whenever I write these three characters the Phpstorm complete the remains.

Another thing you may notice, that Phpstorm has many plugins to support many things like composer and also PHP frameworks, content management systems, but

Unfortunately, Codeigniter not being one of them which means you cannot take advantage of auto-completion.

Phpstorm

Although supporting Codeigniter in Phpstorm not found yet, but you will find PHP storm Codeigniter helper which will help you a lot with auto complete in Codeigniter.

After downloading this helper you can copy the code and put in parent class which you inherited from in all your project classes and it will give you decent autocompletion support.

Codeigniter Phpstorm

5- Google it, be smarter.

In PHP world you are not alone, in Codeigniter world the same, always there was the same problem that someone ran into beforehand.

So don't reinvent the wheel, just take your time to search, look at other’s code this will help you twice, to improve your coding skills and to increase your productivity.

Sometimes you will find the solution in Codeigniter forum, sometimes in Codeigniter blogs like Webeasystep :) or maybe in PHP community, then your role to convert it to a code igniter library or helper to make our community rich.

These my quick tips to share and I hope to help you and will be very happy with your shares


Leave a Reply

Your email address will not be published.

Use this dialog to configure running and debugging of PHP applications on a remote server. According to the settings of this configuration, PhpStorm fully controls the debugging process: it launches the application, opens the browser, and activates the debugging engine. A PHP Web Page debug configuration tells PhpStorm the URL address to access the starting page of the application, the browser to open the starting page in, and the debug server configuration to use. For details, see Debug with a PHP web page debug configuration.

Config Codeigniter Phpstorm

Codeigniter

Configuration area

ItemDescription
ServerUse this list to specify the Web server configuration to use. The list shows all the configurations that are currently available in PhpStorm.
Click this button to open the Servers page and view the details of the selected configuration there.
Start URLIn this area, compose the URL address to access the application through. In the Start URL field, specify the local file that implements the starting page of the application. Type the path to the desired file relative to the folder that is mapped to the root folder of the target host. PhpStorm concatenates the host root URL with the specified relative path and shows the URL address of the application starting page in the read-only field below.
BrowserFrom this list, select the Web browser to open the application in.

Common

When you edit a run configuration (but not a run configuration template), you can specify the following options:

Item

Description

Name

Specify a name for the run/debug configuration to quickly identify it when editing or running the configuration, for example, from the Run popup Alt+Shift+F10.

Allow parallel run

Select to allow running multiple instances of this run configuration in parallel.

By default, it is disabled, and when you start this configuration while another instance is still running, PhpStorm suggests to stop the running instance and start another one. This is helpful when a run/debug configuration consumes a lot of resources and there is no good reason to run multiple instances.

Gbf upgrade siero shop. Store as project file

Save the file with the run configuration settings to share it with other team members. The default location is .idea/runConfigurations. However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project.

By default, it is disabled, and PhpStorm stores run configuration settings in .idea/workspace.xml.

Toolbar

The tree view of run/debug configurations has a toolbar that helps you manage configurations available in your project as well as adjust default configurations templates. Mazhathullikilukkam mp3 songs.

ItemShortcutDescription
Alt+InsertCreate a run/debug configuration.
Alt+DeleteDelete the selected run/debug configuration. Note that you cannot delete default configurations.
Ctrl+DCreate a copy of the selected run/debug configuration. Note that you create copies of default configurations.
The button is displayed only when you select a temporary configuration. Click this button to save a temporary configuration as permanent.
View and edit the template (that is, the default run/debug configuration settings). The templates are displayed under the Templates node and used for newly created configurations.
/ Alt+Up/ Alt+Down

Move the selected run/debug configuration up and down in the list.

The order of configurations in the list defines the order, in which the configurations appear when you choose a run/debug configuration.

Default templates of run/debug configurations are always sorted alphabetically.

Move into new folder / Create new folder. You can group run/debug configurations by placing them into folders.

To create a folder, select the configurations within a category, click , and specify the folder name. If only a category is in focus, an empty folder is created.

Then, to move a configuration into a folder, between the folders or out of a folder, use drag or and buttons.

To remove grouping, select a folder and click .

Click this button to sort configurations in the alphabetical order.

Before Launch

Phpstorm Codeigniter 설정

In this area, you can specify tasks to be performed before starting the selected run/debug configuration. The tasks are performed in the order they appear in the list.

Phpstorm codeigniter debug

Codeigniter Phpstorm Code Completion

ItemShortcutDescription
Alt+Insert

Click this icon to add one of the following available tasks:

  • Run External tool: select to run an external application. In the dialog that opens, select one or multiple applications you want to run. If it is not defined in PhpStorm yet, add its definition. For more information, see External tools and External Tools.

  • Run Another Configuration: select to execute another run/debug configuration. In the dialog that opens, select the configuration to be run.

  • Launch Web Browser: select this option to have a browser started. In the dialog that opens, select the type of the browser and provide the start URL. Also, specify if you want the browser be launched with JavaScript debugger.

  • Run File Watchers: select this option to have PhpStorm apply all the currently active File Watchers.

  • Run Grunt task: select this option to run a Grunt task.

    In the Grunt task dialog that opens, specify the Gruntfile.js where the required task is defined, select the task to execute, and specify the arguments to pass to the Grunt tool.

    Specify the location of the Node.js interpreter, the parameters to pass to it, and the path to the grunt-cli package.

  • Run Gulp task: select this option to run a Gulp task.

    In the Gulp task dialog that opens, specify the Gulpfile.js where the required task is defined, select the task to execute, and specify the arguments to pass to the Gulp tool.

    Specify the location of the Node.js interpreter, the parameters to pass to it, and the path to the gulp package.

  • Run npm Script: select this option to execute an npm script.

    In the NPM Script dialog that opens, specify the npm run/debug configuration settings.
  • Compile TypeScript: select to run the built-in TypeScript compiler and thus make sure that all the changes you made to your TypeScript code are reflected in the generated JavaScript files. In the TypeScript Compile Settings dialog that opens, select or clear the Check errors checkbox to configure the behaviour of the compiler in case any errors are detected:

    • If the Check errors checkbox is selected, the compiler will show all the errors and the run configuration will not start.

    • If the Check errors checkbox is cleared, the compiler will show all the detected errors but the run configuration still will be launched.

  • Run Phing target: add this task to execute the specified Phing target prior to running or debugging. To appoint a Phing target, click Browse and select the desired target in the dialog that opens.

  • Generate CoffeeScript Source Maps: select this option to generate the source maps for your CoffeeScript sources. In the dialog that opens, specify where your CoffeeScript source files are located.

  • Upload files to Remote Host: select this option to have the application files automatically uploaded to the server according to the default server access configuration.

  • Run Remote External tool: adds a remote SSH external tool.

Alt+DeleteClick this icon to remove the selected task from the list.
EnterClick this icon to edit the selected task. Make the necessary changes in the dialog that opens.
/ Alt+Up/ Alt+DownClick these icons to move the selected task one line up or down in the list. The tasks are performed in the order that they appear in the list.
Show this pageSelect this checkbox to show the run/debug configuration settings prior to actually starting the run/debug configuration.
Activate tool window

By default this checkbox is selected and the Run or the Debug tool window opens when you start the run/debug configuration.

Otherwise, if the checkbox is cleared, the tool window is hidden. However, when the configuration is running, you can open the corresponding tool window for it yourself by pressing Alt+4 or Alt+5.